From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> |
Cc: | Andrew Dunstan <andrew(at)dunslane(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: [PATCHES] Warning for missing createlang |
Date: | 2003-09-05 17:25:26 |
Message-ID: | 2192.1062782726@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers pgsql-patches |
Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
>> BTW, duplicating the ereport is no fun. I'd suggest the coding style
>> used in some other places, with errhint called in a conditional
>> expression:
> Why does the ': 0' work? I didn't figure that would work, but it does.
The return values of the errxxx() subfunctions don't matter (they all
just return zero anyway). What they do is stuff their arguments into
a behind-the-scenes data structure that ereport will use when control
finally gets to it. ereport is declared as taking a "..." argument
list, but it makes no attempt to actually look at what was passed as
its arguments. So we don't really care what happens when the
?-expression test fails, as long as errhint() doesn't execute. A
constant zero is about the minimum thing we can put in the else-part
to keep the compiler happy.
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | Nico King | 2003-09-05 17:30:26 | Re: Question about Scripting in Postgresql. |
Previous Message | Andrew Dunstan | 2003-09-05 17:24:19 | Re: TCP/IP with 7.4 beta2 broken? |
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2003-09-05 17:36:00 | Re: psql \h alter scrolls of screen |
Previous Message | Bruce Momjian | 2003-09-05 17:18:50 | Re: [PATCHES] Warning for missing createlang |