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

From Steve Singer
Subject Re: pg_upgrade segfaults when given an invalid PGSERVICE value
Date
Msg-id 51506649.2020300@ca.afilias.info
Whole thread Raw
In response to Re: pg_upgrade segfaults when given an invalid PGSERVICE value  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: pg_upgrade segfaults when given an invalid PGSERVICE value  (Bruce Momjian <bruce@momjian.us>)
List pgsql-hackers
On 13-03-20 05:54 PM, Tom Lane wrote:
> Steve Singer <ssinger@ca.afilias.info> writes:

>
>>   From a end-user expectations point of view I am okay with somehow
>> marking the structure returned by PQconndefaults in a way that the
>> connect calls will later fail.
>
> Unless the program changes the value of PGSERVICE, surely all subsequent
> connection attempts will fail for the same reason, regardless of what
> PQconndefaults returns?
>
>             regards, tom lane
>
>

So your proposing we do something like the attached patch?  Where we
change conninfo_add_defaults to ignore an invalid PGSERVICE if being
called by PQconndefaults() but keep the existing behaviour in other
contexts where it is actually being used to establish a connection?

In this case even if someone takes the result of PQconndefaults and uses
that to build connection options for a new connection it should fail
when it does the pgservice lookup when establishing the connection.
That sounds reasonable to me.

Steve

Attachment

pgsql-hackers by date:

Previous
From: Joe Conway
Date:
Subject: Re: pg_dump selectively ignores extension configuration tables
Next
From: Heikki Linnakangas
Date:
Subject: Re: [COMMITTERS] pgsql: Add PF_PRINTF_ATTRIBUTE to on_exit_msg_fmt.