Re: BUG #5304: psql using conninfo fails in connecting to the server - Mailing list pgsql-bugs

From Joe Conway
Subject Re: BUG #5304: psql using conninfo fails in connecting to the server
Date
Msg-id 4B68DE97.30906@joeconway.com
Whole thread Raw
In response to Re: BUG #5304: psql using conninfo fails in connecting to the server  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: BUG #5304: psql using conninfo fails in connecting to the server  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
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

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #5304: psql using conninfo fails in connecting to the server
Next
From: Tom Lane
Date:
Subject: Re: BUG #5304: psql using conninfo fails in connecting to the server