1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-24 00:23:06 +03:00

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
This commit is contained in:
Bruce Momjian
2020-10-02 22:19:30 -04:00
parent fa05c22879
commit 3b8402170a
11 changed files with 53 additions and 47 deletions

View 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.