Re: [PATCHES] Warning for missing createlang - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [PATCHES] Warning for missing createlang
Date
Msg-id 2192.1062782726@sss.pgh.pa.us
Whole thread Raw
In response to Re: [PATCHES] Warning for missing createlang  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-hackers
Bruce Momjian <pgman@candle.pha.pa.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


pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: TCP/IP with 7.4 beta2 broken?
Next
From: Nico King
Date:
Subject: Re: Question about Scripting in Postgresql.