From dfb2d8039eb714d6b582a8cb8a7993c98b88a224 Mon Sep 17 00:00:00 2001 From: Noah Misch Date: Mon, 8 Aug 2016 10:07:46 -0400 Subject: Introduce a psql "\connect -reuse-previous=on|off" option. The decision to reuse values of parameters from a previous connection has been based on whether the new target is a conninfo string. Add this means of overriding that default. This feature arose as one component of a fix for security vulnerabilities in pg_dump, pg_dumpall, and pg_upgrade, so back-patch to 9.1 (all supported versions). In 9.3 and later, comment paragraphs that required update had already-incorrect claims about behavior when no connection is open; fix those problems. Security: CVE-2016-5424 --- doc/src/sgml/ref/psql-ref.sgml | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml index 3395fad60bd..fdcc62a4493 100644 --- a/doc/src/sgml/ref/psql-ref.sgml +++ b/doc/src/sgml/ref/psql-ref.sgml @@ -775,7 +775,7 @@ testdb=> - \c or \connect [ dbname [ username ] [ host ] [ port ] ] | conninfo + \c or \connect [ -reuse-previous=on|off ] [ dbname [ username ] [ host ] [ port ] | conninfo ] Establishes a new connection to a PostgreSQL @@ -785,16 +785,19 @@ testdb=> - When using positional parameters, if any of - dbname, + Where the command omits database name, user, host, or port, the new + connection can reuse values from the previous connection. By default, + values from the previous connection are reused except when processing + a conninfo string. Passing a first argument + of -reuse-previous=on + or -reuse-previous=off overrides that default. + When the command neither specifies nor reuses a particular parameter, + the libpq default is used. Specifying any + of dbname, username, host or - port are omitted or - specified as -, the value of that parameter from - the previous connection is used; if there is no previous connection, - the libpq default for the parameter's value - is used. When using conninfo strings, no values from the - previous connection are used for the new connection. + port + as - is equivalent to omitting that parameter. -- cgit v1.2.3