Re: pg_upgrade segfaults when given an invalid PGSERVICE value

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Steve Singer <ssinger(at)ca(dot)afilias(dot)info>, PostgreSQL-development Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_upgrade segfaults when given an invalid PGSERVICE value
Date: 2013-03-20 16:30:32
Message-ID: 5337.1363797032@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bruce Momjian <bruce(at)momjian(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniele Varrazzo 2013-03-20 16:37:16 Re: A few string fixed
Previous Message Alvaro Herrera 2013-03-20 16:13:22 Re: Problem with background worker