Skip site navigation (1) Skip section navigation (2)

Re: pg_upgrade segfaults when given an invalid PGSERVICE value

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Steve Singer <ssinger(at)ca(dot)afilias(dot)info>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>,PostgreSQL-development Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_upgrade segfaults when given an invalid PGSERVICE value
Date: 2013-12-03 16:12:13
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
On Fri, Nov 29, 2013 at 04:14:00PM -0500, Bruce Momjian wrote:
> On Thu, Mar 28, 2013 at 03:06:30PM -0400, Steve Singer wrote:
> > So to summarise:
> > 
> > Plan A: The first patch I attached for pg_upgrade + documentation
> > changes, and changing the other places that call PQconndefaults() to
> > accept failures on either out of memory, or an invalid PGSERVICE
> > 
> > Plan B: Create a new function PQconndefaults2(char * errorBuffer) or
> > something similar that returned error information to the caller.
> > 
> > Plan C: PQconndefaults() just ignores an invalid service but
> > connection attempts fail because other callers of
> > conninfo_add_defaults still pay attention to connection failures.
> > This is the second patch I sent.
> > 
> > Plan D:  Service lookup failures are always ignored by
> > conninfo_add_defaults. If you attempt to connect with a bad
> > PGSERVICE set it will behave as if no PGSERVICE value was set.   I
> > don't think anyone explicitly proposed this yet.
> > 
> > Plan 'D' is the only option that I'm opposed to, it will effect a
> > lot more applications then ones that call PQconndefaults() and I
> > feel it will confuse users.
> > 
> > I'm not convinced plan B is worth the effort of having to maintain
> > two versions of PQconndefaults() for a while to fix a corner case.
> OK, I am back to looking at this issue from March.  I went with option
> C, patch attached, which seems to be the most popular.  It is similar to
> Steve's patch, but structured differently and includes a doc patch.

Patch applied.

  Bruce Momjian  <bruce(at)momjian(dot)us>

  + Everyone has their own god. +

In response to

pgsql-hackers by date

Next:From: Bruce MomjianDate: 2013-12-03 16:12:46
Subject: pgsql: libpq: change PQconndefaults() to ignore invalid service files
Previous:From: Claudio FreireDate: 2013-12-03 15:56:11
Subject: Re: Parallel Select query performance and shared buffers

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group