Joe Conway <m...@joeconway.com> writes: > On 02/02/2010 06:10 PM, Tom Lane wrote: >> 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. The difference with PQconnectdbParams is that the dbname might not be the first thing in the parameter array. I think that a straightforward implementation would have the effect of the expanded dbname overriding parameters given before it, but not those given after it. Consider keyword[0] = "port"; values[0] = "5678"; keyword[1] = "dbname"; values[1] = "dbname = db user = foo port = 9999"; keyword[2] = "user"; values[2] = "uu"; What I'm imagining is that this would end up equivalent to dbname = db user = uu port = 9999. That's probably reasonable, and maybe even useful, as long as it's documented. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs