From 6c1d521af35e496639bbb39764c30115879af47f Mon Sep 17 00:00:00 2001 From: Heikki Linnakangas Date: Tue, 25 Nov 2014 17:12:07 +0200 Subject: 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. --- doc/src/sgml/libpq.sgml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'doc/src') diff --git a/doc/src/sgml/libpq.sgml b/doc/src/sgml/libpq.sgml index 6d561a3d8c1..c7ac9f2671e 100644 --- a/doc/src/sgml/libpq.sgml +++ b/doc/src/sgml/libpq.sgml @@ -124,7 +124,10 @@ PGconn *PQconnectdbParams(const char * const *keywords, When expand_dbname is non-zero, the dbname key word value is allowed to be recognized - as a connection string. More details on the possible formats appear in + as a connection string. Only the first occurrence of + dbname is expanded this way, any subsequent + dbname value is processed as plain database name. More + details on the possible connection string formats appear in . -- cgit v1.2.3