diff options
author | Noah Misch <noah@leadboat.com> | 2016-08-08 10:07:46 -0400 |
---|---|---|
committer | Noah Misch <noah@leadboat.com> | 2016-08-08 10:07:46 -0400 |
commit | 9d924e9a64b91571e04252424c01210fc0f6f6d9 (patch) | |
tree | 53c5443f7e055e4941b0070ddbab32fa61413dcc /doc/src | |
parent | 984e5beb38a7c79a5a9243865d9598c405df17f6 (diff) |
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
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/sgml/ref/psql-ref.sgml | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml index a4d3e429f67..d9bce25f337 100644 --- a/doc/src/sgml/ref/psql-ref.sgml +++ b/doc/src/sgml/ref/psql-ref.sgml @@ -825,7 +825,7 @@ testdb=> </varlistentry> <varlistentry> - <term><literal>\c</literal> or <literal>\connect</literal> <literal>[ <replaceable class="parameter">dbname</replaceable> [ <replaceable class="parameter">username</replaceable> ] [ <replaceable class="parameter">host</replaceable> ] [ <replaceable class="parameter">port</replaceable> ] ] | <replaceable class="parameter">conninfo</replaceable> </literal></term> + <term><literal>\c</literal> or <literal>\connect [ -reuse-previous=<replaceable class="parameter">on|off</replaceable> ] [ <replaceable class="parameter">dbname</replaceable> [ <replaceable class="parameter">username</replaceable> ] [ <replaceable class="parameter">host</replaceable> ] [ <replaceable class="parameter">port</replaceable> ] | <replaceable class="parameter">conninfo</replaceable> ]</literal></term> <listitem> <para> Establishes a new connection to a <productname>PostgreSQL</> @@ -835,16 +835,19 @@ testdb=> </para> <para> - When using positional parameters, if any of - <replaceable class="parameter">dbname</replaceable>, + 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 <literal>conninfo</> string. Passing a first argument + of <literal>-reuse-previous=on</> + or <literal>-reuse-previous=off</literal> overrides that default. + When the command neither specifies nor reuses a particular parameter, + the <application>libpq</application> default is used. Specifying any + of <replaceable class="parameter">dbname</replaceable>, <replaceable class="parameter">username</replaceable>, <replaceable class="parameter">host</replaceable> or - <replaceable class="parameter">port</replaceable> are omitted or - specified as <literal>-</literal>, the value of that parameter from - the previous connection is used; if there is no previous connection, - the <application>libpq</application> default for the parameter's value - is used. When using <literal>conninfo</> strings, no values from the - previous connection are used for the new connection. + <replaceable class="parameter">port</replaceable> + as <literal>-</literal> is equivalent to omitting that parameter. </para> <para> |