Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit d2c9ef1

Browse files
committed
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
1 parent 566c6d4 commit d2c9ef1

11 files changed

+53
-47
lines changed

doc/src/sgml/ref/clusterdb.sgml

+4-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,10 @@ PostgreSQL documentation
9595
<option>--all</option>) is not used, the database name is read
9696
from the environment variable <envar>PGDATABASE</envar>. If
9797
that is not set, the user name specified for the connection is
98-
used.
98+
used. The <replaceable>dbname</replaceable> can be a <link
99+
linkend="libpq-connstring">connection string</link>. If so,
100+
connection string parameters will override any conflicting command
101+
line options.
99102
</para>
100103
</listitem>
101104
</varlistentry>

doc/src/sgml/ref/pg_basebackup.sgml

+3-2
Original file line numberDiff line numberDiff line change
@@ -653,8 +653,9 @@ PostgreSQL documentation
653653
<term><option>--dbname=<replaceable class="parameter">connstr</replaceable></option></term>
654654
<listitem>
655655
<para>
656-
Specifies parameters used to connect to the server, as a connection
657-
string. See <xref linkend="libpq-connstring"/> for more information.
656+
Specifies parameters used to connect to the server, as a <link
657+
linkend="libpq-connstring">connction string</link>; these
658+
will override any conflicting command line options.
658659
</para>
659660
<para>
660661
The option is called <literal>--dbname</literal> for consistency with other

doc/src/sgml/ref/pg_dump.sgml

+4-8
Original file line numberDiff line numberDiff line change
@@ -1129,14 +1129,10 @@ PostgreSQL documentation
11291129
Specifies the name of the database to connect to. This is
11301130
equivalent to specifying <replaceable
11311131
class="parameter">dbname</replaceable> as the first non-option
1132-
argument on the command line.
1133-
</para>
1134-
<para>
1135-
If this parameter contains an <symbol>=</symbol> sign or starts
1136-
with a valid <acronym>URI</acronym> prefix
1137-
(<literal>postgresql://</literal>
1138-
or <literal>postgres://</literal>), it is treated as a
1139-
<parameter>conninfo</parameter> string. See <xref linkend="libpq-connect"/> for more information.
1132+
argument on the command line. The <replaceable>dbname</replaceable>
1133+
can be a <link linkend="libpq-connstring">connection string</link>.
1134+
If so, connection string parameters will override any conflicting
1135+
command line options.
11401136
</para>
11411137
</listitem>
11421138
</varlistentry>

doc/src/sgml/ref/pg_dumpall.sgml

+3-2
Original file line numberDiff line numberDiff line change
@@ -550,8 +550,9 @@ PostgreSQL documentation
550550
<term><option>--dbname=<replaceable class="parameter">connstr</replaceable></option></term>
551551
<listitem>
552552
<para>
553-
Specifies parameters used to connect to the server, as a connection
554-
string. See <xref linkend="libpq-connstring"/> for more information.
553+
Specifies parameters used to connect to the server, as a <link
554+
linkend="libpq-connstring">connction string</link>; these
555+
will override any conflicting command line options.
555556
</para>
556557
<para>
557558
The option is called <literal>--dbname</literal> for consistency with other

doc/src/sgml/ref/pg_isready.sgml

+5-9
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,11 @@ PostgreSQL documentation
4747
<term><option>--dbname=<replaceable class="parameter">dbname</replaceable></option></term>
4848
<listitem>
4949
<para>
50-
Specifies the name of the database to connect to.
51-
</para>
52-
<para>
53-
If this parameter contains an <symbol>=</symbol> sign or starts
54-
with a valid <acronym>URI</acronym> prefix
55-
(<literal>postgresql://</literal>
56-
or <literal>postgres://</literal>), it is treated as a
57-
<parameter>conninfo</parameter> string. See <xref
58-
linkend="libpq-connstring"/> for more information.
50+
Specifies the name of the database to connect to. The
51+
<replaceable>dbname</replaceable> can be a <link
52+
linkend="libpq-connstring">connection string</link>. If so,
53+
connection string parameters will override any conflicting command
54+
line options.
5955
</para>
6056
</listitem>
6157
</varlistentry>

doc/src/sgml/ref/pg_receivewal.sgml

+3-2
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,9 @@ PostgreSQL documentation
252252
<term><option>--dbname=<replaceable class="parameter">connstr</replaceable></option></term>
253253
<listitem>
254254
<para>
255-
Specifies parameters used to connect to the server, as a connection
256-
string. See <xref linkend="libpq-connstring"/> for more information.
255+
Specifies parameters used to connect to the server, as a <link
256+
linkend="libpq-connstring">connction string</link>; these
257+
will override any conflicting command line options.
257258
</para>
258259
<para>
259260
The option is called <literal>--dbname</literal> for consistency with other

doc/src/sgml/ref/pg_recvlogical.sgml

+8-6
Original file line numberDiff line numberDiff line change
@@ -273,14 +273,16 @@ PostgreSQL documentation
273273

274274
<variablelist>
275275
<varlistentry>
276-
<term><option>-d <replaceable>database</replaceable></option></term>
277-
<term><option>--dbname=<replaceable>database</replaceable></option></term>
276+
<term><option>-d <replaceable>dbname</replaceable></option></term>
277+
<term><option>--dbname=<replaceable>dbname</replaceable></option></term>
278278
<listitem>
279279
<para>
280-
The database to connect to. See the description of the actions for
281-
what this means in detail. This can be a <application>libpq</application> connection string;
282-
see <xref linkend="libpq-connstring"/> for more information. Defaults
283-
to user name.
280+
The database to connect to. See the description
281+
of the actions for what this means in detail.
282+
The <replaceable>dbname</replaceable> can be a <link
283+
linkend="libpq-connstring">connection string</link>. If so,
284+
connection string parameters will override any conflicting
285+
command line options. Defaults to the user name.
284286
</para>
285287
</listitem>
286288
</varlistentry>

doc/src/sgml/ref/pg_restore.sgml

+4-1
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,10 @@ PostgreSQL documentation
156156
<para>
157157
Connect to database <replaceable
158158
class="parameter">dbname</replaceable> and restore directly
159-
into the database.
159+
into the database. The <replaceable>dbname</replaceable> can
160+
be a <link linkend="libpq-connstring">connection string</link>.
161+
If so, connection string parameters will override any conflicting
162+
command line options.
160163
</para>
161164
</listitem>
162165
</varlistentry>

doc/src/sgml/ref/psql-ref.sgml

+11-14
Original file line numberDiff line numberDiff line change
@@ -168,15 +168,10 @@ EOF
168168
Specifies the name of the database to connect to. This is
169169
equivalent to specifying <replaceable
170170
class="parameter">dbname</replaceable> as the first non-option
171-
argument on the command line.
172-
</para>
173-
<para>
174-
If this parameter contains an <symbol>=</symbol> sign or starts
175-
with a valid <acronym>URI</acronym> prefix
176-
(<literal>postgresql://</literal>
177-
or <literal>postgres://</literal>), it is treated as a
178-
<parameter>conninfo</parameter> string. See <xref
179-
linkend="libpq-connstring"/> for more information.
171+
argument on the command line. The <replaceable>dbname</replaceable>
172+
can be a <link linkend="libpq-connstring">connection string</link>.
173+
If so, connection string parameters will override any conflicting
174+
command line options.
180175
</para>
181176
</listitem>
182177
</varlistentry>
@@ -498,7 +493,7 @@ EOF
498493
<listitem>
499494
<para>
500495
Never issue a password prompt. If the server requires password
501-
authentication and a password is not available by other means
496+
authentication and a password is not available from other sources
502497
such as a <filename>.pgpass</filename> file, the connection
503498
attempt will fail. This option can be useful in batch jobs and
504499
scripts where no user is present to enter a password.
@@ -518,13 +513,15 @@ EOF
518513
<listitem>
519514
<para>
520515
Force <application>psql</application> to prompt for a
521-
password before connecting to a database.
516+
password before connecting to a database, even if the password will
517+
not be used.
522518
</para>
523519

524520
<para>
525-
This option is never essential, since <application>psql</application>
526-
will automatically prompt for a password if the server demands
527-
password authentication. However, <application>psql</application>
521+
If the server requires password authentication and a password is not
522+
available from other sources such as a <filename>.pgpass</filename>
523+
file, <application>psql</application> will prompt for a
524+
password in any case. However, <application>psql</application>
528525
will waste a connection attempt finding out that the server wants a
529526
password. In some cases it is worth typing <option>-W</option> to avoid
530527
the extra connection attempt.

doc/src/sgml/ref/reindexdb.sgml

+4-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,10 @@ PostgreSQL documentation
139139
<option>--all</option>) is not used, the database name is read
140140
from the environment variable <envar>PGDATABASE</envar>. If
141141
that is not set, the user name specified for the connection is
142-
used.
142+
used. The <replaceable>dbname</replaceable> can be a <link
143+
linkend="libpq-connstring">connection string</link>. If so,
144+
connection string parameters will override any conflicting command
145+
line options.
143146
</para>
144147
</listitem>
145148
</varlistentry>

doc/src/sgml/ref/vacuumdb.sgml

+4-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,10 @@ PostgreSQL documentation
9797
<option>--all</option>) is not used, the database name is read
9898
from the environment variable <envar>PGDATABASE</envar>. If
9999
that is not set, the user name specified for the connection is
100-
used.
100+
used. The <replaceable>dbname</replaceable> can be a <link
101+
linkend="libpq-connstring">connection string</link>. If so,
102+
connection string parameters will override any conflicting command
103+
line options.
101104
</para>
102105
</listitem>
103106
</varlistentry>

0 commit comments

Comments
 (0)