pgsql: Allow "dbname" from connection string to be overridden in PQconn

From: Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Allow "dbname" from connection string to be overridden in PQconn
Date: 2014-11-25 15:44:17
Message-ID: E1XtIHp-0004pS-31@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Allow "dbname" from connection string to be overridden in PQconnectDBParams

If the "dbname" attribute in PQconnectDBParams contained a connection string
or URI (and expand_dbname = TRUE), the database name from the connection
string could not be overridden by a subsequent "dbname" keyword in the
array. That was not intentional; all other options can be overridden.
Furthermore, any subsequent "dbname" caused the connection string from the
first dbname value to be processed again, overriding any values for the same
options that were given between the connection string and the second dbname
option.

In the passing, clarify in the docs that only the first dbname option in the
array is parsed as a connection string.

Alex Shulgin. Backpatch to all supported versions.

Branch
------
REL9_4_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/6c1d521af35e496639bbb39764c30115879af47f

Modified Files
--------------
doc/src/sgml/libpq.sgml | 5 ++++-
src/interfaces/libpq/fe-connect.c | 17 ++++++++++++-----
2 files changed, 16 insertions(+), 6 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Heikki Linnakangas 2014-11-25 16:26:37 pgsql: Allow using connection URI in primary_conninfo.
Previous Message Stephen Frost 2014-11-25 15:05:05 pgsql: Suppress DROP CASCADE notices in regression tests