Re: pg_upgrade segfaults when given an invalid PGSERVICE value - Mailing list pgsql-hackers

From Tom Lane
Subject Re: pg_upgrade segfaults when given an invalid PGSERVICE value
Date
Msg-id 5337.1363797032@sss.pgh.pa.us
Whole thread Raw
In response to Re: pg_upgrade segfaults when given an invalid PGSERVICE value  (Bruce Momjian <bruce@momjian.us>)
Responses Re: pg_upgrade segfaults when given an invalid PGSERVICE value  (Bruce Momjian <bruce@momjian.us>)
List pgsql-hackers
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



pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Problem with background worker
Next
From: Daniele Varrazzo
Date:
Subject: Re: A few string fixed