diff options
author | Bruce Momjian <bruce@momjian.us> | 2020-10-02 22:19:30 -0400 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2020-10-02 22:19:30 -0400 |
commit | 65aa18e85a0557e68d0e7464cc2ea8d417f3e577 (patch) | |
tree | 371c84e01d17ccae871ac335c04c7f2dc1a00d92 | |
parent | 934bb65fdf3c03c981d6a2ff2bfa93bf7bb463f6 (diff) |
doc: libpq connection options can override command-line flags
Reported-by: Alexander Lakhin
Discussion: https://postgr.es/m/16486-b9c93d71c02c4907@postgresql.org
Backpatch-through: 9.5
-rw-r--r-- | doc/src/sgml/ref/clusterdb.sgml | 5 | ||||
-rw-r--r-- | doc/src/sgml/ref/pg_basebackup.sgml | 5 | ||||
-rw-r--r-- | doc/src/sgml/ref/pg_dump.sgml | 12 | ||||
-rw-r--r-- | doc/src/sgml/ref/pg_dumpall.sgml | 5 | ||||
-rw-r--r-- | doc/src/sgml/ref/pg_isready.sgml | 14 | ||||
-rw-r--r-- | doc/src/sgml/ref/pg_receivewal.sgml | 5 | ||||
-rw-r--r-- | doc/src/sgml/ref/pg_recvlogical.sgml | 14 | ||||
-rw-r--r-- | doc/src/sgml/ref/pg_restore.sgml | 5 | ||||
-rw-r--r-- | doc/src/sgml/ref/psql-ref.sgml | 25 | ||||
-rw-r--r-- | doc/src/sgml/ref/reindexdb.sgml | 5 | ||||
-rw-r--r-- | doc/src/sgml/ref/vacuumdb.sgml | 5 |
11 files changed, 53 insertions, 47 deletions
diff --git a/doc/src/sgml/ref/clusterdb.sgml b/doc/src/sgml/ref/clusterdb.sgml index 67582fd6e69..099d140ac87 100644 --- a/doc/src/sgml/ref/clusterdb.sgml +++ b/doc/src/sgml/ref/clusterdb.sgml @@ -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> diff --git a/doc/src/sgml/ref/pg_basebackup.sgml b/doc/src/sgml/ref/pg_basebackup.sgml index e29476b14fd..d838fe0bd13 100644 --- a/doc/src/sgml/ref/pg_basebackup.sgml +++ b/doc/src/sgml/ref/pg_basebackup.sgml @@ -515,8 +515,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</> for consistency with other diff --git a/doc/src/sgml/ref/pg_dump.sgml b/doc/src/sgml/ref/pg_dump.sgml index 4b7631a4369..25a86a3cfc4 100644 --- a/doc/src/sgml/ref/pg_dump.sgml +++ b/doc/src/sgml/ref/pg_dump.sgml @@ -1028,14 +1028,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> diff --git a/doc/src/sgml/ref/pg_dumpall.sgml b/doc/src/sgml/ref/pg_dumpall.sgml index 9af2f5b9e78..00bf5e6739a 100644 --- a/doc/src/sgml/ref/pg_dumpall.sgml +++ b/doc/src/sgml/ref/pg_dumpall.sgml @@ -467,8 +467,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</> for consistency with other diff --git a/doc/src/sgml/ref/pg_isready.sgml b/doc/src/sgml/ref/pg_isready.sgml index 2ee79a0bbeb..f966d0feed4 100644 --- a/doc/src/sgml/ref/pg_isready.sgml +++ b/doc/src/sgml/ref/pg_isready.sgml @@ -47,15 +47,11 @@ PostgreSQL documentation <term><option>--dbname=<replaceable class="parameter">dbname</replaceable></></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> diff --git a/doc/src/sgml/ref/pg_receivewal.sgml b/doc/src/sgml/ref/pg_receivewal.sgml index d2cd2d63330..e2cfb1786cb 100644 --- a/doc/src/sgml/ref/pg_receivewal.sgml +++ b/doc/src/sgml/ref/pg_receivewal.sgml @@ -214,8 +214,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</> for consistency with other diff --git a/doc/src/sgml/ref/pg_recvlogical.sgml b/doc/src/sgml/ref/pg_recvlogical.sgml index 9c7bb1907be..5ac20ba90d2 100644 --- a/doc/src/sgml/ref/pg_recvlogical.sgml +++ b/doc/src/sgml/ref/pg_recvlogical.sgml @@ -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> diff --git a/doc/src/sgml/ref/pg_restore.sgml b/doc/src/sgml/ref/pg_restore.sgml index 73a34834dce..0fddbe7dcc3 100644 --- a/doc/src/sgml/ref/pg_restore.sgml +++ b/doc/src/sgml/ref/pg_restore.sgml @@ -145,7 +145,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> diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml index 2f747c4be61..992b23e7f2f 100644 --- a/doc/src/sgml/ref/psql-ref.sgml +++ b/doc/src/sgml/ref/psql-ref.sgml @@ -157,15 +157,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> @@ -487,7 +482,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. @@ -507,13 +502,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</> to avoid the extra connection attempt. diff --git a/doc/src/sgml/ref/reindexdb.sgml b/doc/src/sgml/ref/reindexdb.sgml index e4721d81130..d91697fe8d8 100644 --- a/doc/src/sgml/ref/reindexdb.sgml +++ b/doc/src/sgml/ref/reindexdb.sgml @@ -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> diff --git a/doc/src/sgml/ref/vacuumdb.sgml b/doc/src/sgml/ref/vacuumdb.sgml index 4f6fa0d7085..26e113b058f 100644 --- a/doc/src/sgml/ref/vacuumdb.sgml +++ b/doc/src/sgml/ref/vacuumdb.sgml @@ -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> |