Re: [PATCHES] Warning for missing createlang
От | Tom Lane |
---|---|
Тема | Re: [PATCHES] Warning for missing createlang |
Дата | |
Msg-id | 2192.1062782726@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Re: [PATCHES] Warning for missing createlang (Bruce Momjian <pgman@candle.pha.pa.us>) |
Список | 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 по дате отправления: