]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
doc: libpq connection options can override command-line flags
authorBruce Momjian <bruce@momjian.us>
Sat, 3 Oct 2020 02:19:30 +0000 (22:19 -0400)
committerBruce Momjian <bruce@momjian.us>
Sat, 3 Oct 2020 02:19:30 +0000 (22:19 -0400)
Reported-by: Alexander Lakhin
Discussion: https://postgr.es/m/16486-b9c93d71c02c4907@postgresql.org

Backpatch-through: 9.5

doc/src/sgml/ref/clusterdb.sgml
doc/src/sgml/ref/pg_basebackup.sgml
doc/src/sgml/ref/pg_dump.sgml
doc/src/sgml/ref/pg_dumpall.sgml
doc/src/sgml/ref/pg_isready.sgml
doc/src/sgml/ref/pg_receivewal.sgml
doc/src/sgml/ref/pg_recvlogical.sgml
doc/src/sgml/ref/pg_restore.sgml
doc/src/sgml/ref/psql-ref.sgml
doc/src/sgml/ref/reindexdb.sgml
doc/src/sgml/ref/vacuumdb.sgml

index ed343dd7daec24189a6d5c352b880572accbaca2..95b9e2cf4a572d935f82de026329b91122e1a9f4 100644 (file)
@@ -95,7 +95,10 @@ PostgreSQL documentation
         <option>--all</option>) is not used, the database name is read
         from the environment variable <envar>PGDATABASE</envar>.  If
         that is not set, the user name specified for the connection is
-        used.
+        used.  The <replaceable>dbname</replaceable> can be a <link
+        linkend="libpq-connstring">connection string</link>.  If so,
+        connection string parameters will override any conflicting command
+        line options.
        </para>
       </listitem>
      </varlistentry>
index bc7f02b8e5f855136f07ed5d52800f3271102404..0903d35524d7c2835c06c2e35827e0b517494643 100644 (file)
@@ -546,8 +546,9 @@ PostgreSQL documentation
       <term><option>--dbname=<replaceable class="parameter">connstr</replaceable></option></term>
       <listitem>
        <para>
-        Specifies parameters used to connect to the server, as a connection
-        string. See <xref linkend="libpq-connstring"/> for more information.
+        Specifies parameters used to connect to the server, as a <link
+        linkend="libpq-connstring">connction string</link>;  these
+        will override any conflicting command line options.
        </para>
        <para>
         The option is called <literal>--dbname</literal> for consistency with other
index 3c76aad36066c99e4fa77dc1a0b2f2ec28832df9..9c29e39e63caa89982b374cbbd981598bf1c5631 100644 (file)
@@ -1078,14 +1078,10 @@ PostgreSQL documentation
        Specifies the name of the database to connect to. This is
        equivalent to specifying <replaceable
        class="parameter">dbname</replaceable> as the first non-option
-       argument on the command line.
-      </para>
-      <para>
-       If this parameter contains an <symbol>=</symbol> sign or starts
-       with a valid <acronym>URI</acronym> prefix
-       (<literal>postgresql://</literal>
-       or <literal>postgres://</literal>), it is treated as a
-       <parameter>conninfo</parameter> string. See <xref linkend="libpq-connect"/> for more information.
+       argument on the command line.  The <replaceable>dbname</replaceable>
+       can be a <link linkend="libpq-connstring">connection string</link>.
+       If so, connection string parameters will override any conflicting
+       command line options.
       </para>
       </listitem>
      </varlistentry>
index af0a02bc12958321fcd0564f7d240a0691bb8ec9..067f5cd4036489625b64e5b5b76a5b15cd807eaf 100644 (file)
@@ -508,8 +508,9 @@ PostgreSQL documentation
       <term><option>--dbname=<replaceable class="parameter">connstr</replaceable></option></term>
       <listitem>
        <para>
-        Specifies parameters used to connect to the server, as a connection
-        string. See <xref linkend="libpq-connstring"/> for more information.
+        Specifies parameters used to connect to the server, as a <link
+        linkend="libpq-connstring">connction string</link>;  these
+        will override any conflicting command line options.
        </para>
        <para>
         The option is called <literal>--dbname</literal> for consistency with other
index 9567b57ebe2e9de4f2e35f9f8564d95a20a76f85..5932291ef475f3e87bd4df0c83d025d4a13798ae 100644 (file)
@@ -47,15 +47,11 @@ PostgreSQL documentation
       <term><option>--dbname=<replaceable class="parameter">dbname</replaceable></option></term>
       <listitem>
       <para>
-       Specifies the name of the database to connect to.
-      </para>
-      <para>
-       If this parameter contains an <symbol>=</symbol> sign or starts
-       with a valid <acronym>URI</acronym> prefix
-       (<literal>postgresql://</literal>
-       or <literal>postgres://</literal>), it is treated as a
-       <parameter>conninfo</parameter> string. See <xref
-       linkend="libpq-connstring"/> for more information.
+       Specifies the name of the database to connect to. The
+       <replaceable>dbname</replaceable> can be a <link
+       linkend="libpq-connstring">connection string</link>.  If so,
+       connection string parameters will override any conflicting command
+       line options.
       </para>
       </listitem>
     </varlistentry>
index 9c7b0f48c421d16d6abfa429fab84542f0b5042e..320f219a94d176d03ee0b2ba44d02b7c671f0a56 100644 (file)
@@ -253,8 +253,9 @@ PostgreSQL documentation
       <term><option>--dbname=<replaceable class="parameter">connstr</replaceable></option></term>
       <listitem>
        <para>
-        Specifies parameters used to connect to the server, as a connection
-        string. See <xref linkend="libpq-connstring"/> for more information.
+        Specifies parameters used to connect to the server, as a <link
+        linkend="libpq-connstring">connction string</link>;  these
+        will override any conflicting command line options.
        </para>
        <para>
         The option is called <literal>--dbname</literal> for consistency with other
index 141c5cddce1c9bdf0ec190de85cf7206bf03e258..16eb4fe683015c427c9c312cc1ce48618ff24695 100644 (file)
@@ -273,14 +273,16 @@ PostgreSQL documentation
 
     <variablelist>
       <varlistentry>
-       <term><option>-d <replaceable>database</replaceable></option></term>
-       <term><option>--dbname=<replaceable>database</replaceable></option></term>
+       <term><option>-d <replaceable>dbname</replaceable></option></term>
+       <term><option>--dbname=<replaceable>dbname</replaceable></option></term>
        <listitem>
         <para>
-         The database to connect to.  See the description of the actions for
-         what this means in detail.  This can be a <application>libpq</application> connection string;
-         see <xref linkend="libpq-connstring"/> for more information.  Defaults
-         to user name.
+         The database to connect to.  See the description
+         of the actions for what this means in detail.
+         The <replaceable>dbname</replaceable> can be a <link
+         linkend="libpq-connstring">connection string</link>.  If so,
+         connection string parameters will override any conflicting
+         command line options.  Defaults to the user name.
         </para>
        </listitem>
       </varlistentry>
index e03450362a5d5c960bbe210746f8b92ace167c49..23a94bcc717549edaf54523c47e5d4f373482b6a 100644 (file)
@@ -156,7 +156,10 @@ PostgreSQL documentation
        <para>
         Connect to database <replaceable
         class="parameter">dbname</replaceable> and restore directly
-        into the database.
+        into the database.  The <replaceable>dbname</replaceable> can
+        be a <link linkend="libpq-connstring">connection string</link>.
+        If so, connection string parameters will override any conflicting
+        command line options.
        </para>
       </listitem>
      </varlistentry>
index 4d695c901880706fcda1db449090defe50e7f3a1..342cfa456cbea57ba9b9da1254c7519138de2ab5 100644 (file)
@@ -159,15 +159,10 @@ EOF
        Specifies the name of the database to connect to. This is
        equivalent to specifying <replaceable
        class="parameter">dbname</replaceable> as the first non-option
-       argument on the command line.
-      </para>
-      <para>
-       If this parameter contains an <symbol>=</symbol> sign or starts
-       with a valid <acronym>URI</acronym> prefix
-       (<literal>postgresql://</literal>
-       or <literal>postgres://</literal>), it is treated as a
-       <parameter>conninfo</parameter> string. See <xref
-       linkend="libpq-connstring"/> for more information.
+       argument on the command line.  The <replaceable>dbname</replaceable>
+       can be a <link linkend="libpq-connstring">connection string</link>.
+       If so, connection string parameters will override any conflicting
+       command line options.
       </para>
       </listitem>
     </varlistentry>
@@ -489,7 +484,7 @@ EOF
      <listitem>
       <para>
        Never issue a password prompt.  If the server requires password
-       authentication and a password is not available by other means
+       authentication and a password is not available from other sources
        such as a <filename>.pgpass</filename> file, the connection
        attempt will fail.  This option can be useful in batch jobs and
        scripts where no user is present to enter a password.
@@ -509,13 +504,15 @@ EOF
       <listitem>
       <para>
        Force <application>psql</application> to prompt for a
-       password before connecting to a database.
+       password before connecting to a database, even if the password will
+       not be used.
       </para>
 
       <para>
-       This option is never essential, since <application>psql</application>
-       will automatically prompt for a password if the server demands
-       password authentication.  However, <application>psql</application>
+       If the server requires password authentication and a password is not
+       available from other sources such as a <filename>.pgpass</filename>
+       file, <application>psql</application> will prompt for a
+       password in any case.  However, <application>psql</application>
        will waste a connection attempt finding out that the server wants a
        password.  In some cases it is worth typing <option>-W</option> to avoid
        the extra connection attempt.
index 1273dad807254a4ca20f65597a4cb74f7c3b4ddd..b3313d04a435c3708dd9246035ee357cd38c25a1 100644 (file)
@@ -128,7 +128,10 @@ PostgreSQL documentation
         <option>--all</option>) is not used, the database name is read
         from the environment variable <envar>PGDATABASE</envar>.  If
         that is not set, the user name specified for the connection is
-        used.
+        used.  The <replaceable>dbname</replaceable> can be a <link
+        linkend="libpq-connstring">connection string</link>.  If so,
+        connection string parameters will override any conflicting command
+        line options.
        </para>
       </listitem>
      </varlistentry>
index 955a17a849b0c7fc01eb8fac4e58b1d4cabef442..366873ba3080b0d1fc6932087dbd3913321421c8 100644 (file)
@@ -97,7 +97,10 @@ PostgreSQL documentation
         <option>--all</option>) is not used, the database name is read
         from the environment variable <envar>PGDATABASE</envar>.  If
         that is not set, the user name specified for the connection is
-        used.
+        used.  The <replaceable>dbname</replaceable> can be a <link
+        linkend="libpq-connstring">connection string</link>.  If so,
+        connection string parameters will override any conflicting command
+        line options.
        </para>
       </listitem>
      </varlistentry>