Re: Assert for frontend programs?

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Assert for frontend programs?
Date: 2012-12-14 16:36:01
Message-ID: 50CB5571.5010604@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 12/14/2012 11:33 AM, Tom Lane wrote:
> Heikki Linnakangas <hlinnakangas(at)vmware(dot)com> writes:
>> On 14.12.2012 17:54, Tom Lane wrote:
>>> BTW, I think psql already has a "psql_assert".
>> psql_assert looks like this:
>> #ifdef USE_ASSERT_CHECKING
>> #include <assert.h>
>> #define psql_assert(p) assert(p)
>> #else
>> ...
>> On my Linux system, a failure looks like this:
>> ~$ ./a.out
>> a.out: a.c:5: main: Assertion `1==2' failed.
>> Aborted
>> That seems fine to me.
> Works for me. So just rename that to Assert() and move it into
> postgres-fe.h?
>
>

Seems so simple it's a wonder we didn't do it before. +1.

cheers

andrew

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2012-12-14 16:36:50 Re: gistchoose vs. bloat
Previous Message Tom Lane 2012-12-14 16:33:13 Re: Assert for frontend programs?