diff options
Diffstat (limited to 'doc/src/sgml/ref/psql-ref.sgml')
-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 6bf07d5920e..ec4342fb406 100644 --- a/doc/src/sgml/ref/psql-ref.sgml +++ b/doc/src/sgml/ref/psql-ref.sgml @@ -748,7 +748,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</> @@ -758,16 +758,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> |