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

Re: BUG #5304: psql using conninfo fails in connecting to the server

From: Joe Conway <mail(at)joeconway(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #5304: psql using conninfo fails in connecting to the server
Date: 2010-02-03 02:25:27
Message-ID: 4B68DE97.30906@joeconway.com (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-hackers
On 02/02/2010 06:10 PM, Tom Lane wrote:
> Since we haven't yet released PQconnectdbParams, it's not too late
> to twiddle its API.  What I'm thinking about is an additional
> boolean parameter "expand_dbname", which only if true would enable
> treating an equal-sign-containing dbname like a conninfo string.
> Passing true would be okay for command-line apps where the user is
> supposed to control all the conn parameters anyway, but apps that
> want more security would pass false.

OK

> We should also give more than zero thought to how values coming from the
> expanded dbname should interact with values from other arguments to
> PQconnectdbParams --- which should override which?  And should there be
> an order dependency?

My first thought was to duplicate the logic used by PQsetdbLogin(). It
uses the conninfo string, fills in the defaults using connectOptions1(),
applies the supplied other arguments overriding the defaults, and then
finally computes derived options with connectOptions2(). It is
essentially the same as PQconnectdb() except the supplied parameters are
used before setting the derived options.

Joe

In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2010-02-03 02:40:29
Subject: Re: BUG #5304: psql using conninfo fails in connecting to the server
Previous:From: Tom LaneDate: 2010-02-03 02:10:57
Subject: Re: BUG #5304: psql using conninfo fails in connecting to the server

pgsql-bugs by date

Next:From: Tom LaneDate: 2010-02-03 02:40:29
Subject: Re: BUG #5304: psql using conninfo fails in connecting to the server
Previous:From: Tom LaneDate: 2010-02-03 02:10:57
Subject: Re: BUG #5304: psql using conninfo fails in connecting to the server

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