Bruce Momjian <bruce@momjian.us> writes:
> On Tue, Mar 19, 2013 at 10:12:21AM -0400, Steve Singer wrote:
>>> * Should we document this?
>> Yes the documentation should indicate that PQconndefaults() can
>> return NULL for more than just memory failures.
> The attached patch fixes this. I am unclear about backpatching this as
> it hits lot of code, is rare, and adds new translation strings. On the
> other hand, it does crash the applications.
I don't particularly care for hard-wiring knowledge that bad service
name is the only other reason for PQconndefaults to fail (even assuming
that that's true, a point not in evidence ATM). I care even less for
continuing to use ERRCODE_FDW_OUT_OF_MEMORY for errors clearly outside
its meaning.
I think we should either change PQconndefaults to *not* fail in this
circumstance, or find a way to return an error message.
regards, tom lane