Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit cf42550

Browse filesBrowse 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 d449ec6 commit cf42550
Copy full SHA for cf42550

File tree

Expand file treeCollapse file tree

10 files changed

+50
-45
lines changed
Filter options
Expand file treeCollapse file tree

10 files changed

+50
-45
lines changed

‎doc/src/sgml/ref/clusterdb.sgml

Copy file name to clipboardExpand all lines: doc/src/sgml/ref/clusterdb.sgml
+4-1Lines changed: 4 additions & 1 deletion
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

Copy file name to clipboardExpand all lines: doc/src/sgml/ref/pg_basebackup.sgml
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -444,8 +444,9 @@ PostgreSQL documentation
444444
<term><option>--dbname=<replaceable class="parameter">connstr</replaceable></option></term>
445445
<listitem>
446446
<para>
447-
Specifies parameters used to connect to the server, as a connection
448-
string. See <xref linkend="libpq-connstring"> for more information.
447+
Specifies parameters used to connect to the server, as a <link
448+
linkend="libpq-connstring">connction string</link>; these
449+
will override any conflicting command line options.
449450
</para>
450451
<para>
451452
The option is called <literal>--dbname</> for consistency with other

‎doc/src/sgml/ref/pg_dump.sgml

Copy file name to clipboardExpand all lines: doc/src/sgml/ref/pg_dump.sgml
+4-8Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -979,14 +979,10 @@ PostgreSQL documentation
979979
Specifies the name of the database to connect to. This is
980980
equivalent to specifying <replaceable
981981
class="parameter">dbname</replaceable> as the first non-option
982-
argument on the command line.
983-
</para>
984-
<para>
985-
If this parameter contains an <symbol>=</symbol> sign or starts
986-
with a valid <acronym>URI</acronym> prefix
987-
(<literal>postgresql://</literal>
988-
or <literal>postgres://</literal>), it is treated as a
989-
<parameter>conninfo</parameter> string. See <xref linkend="libpq-connect"> for more information.
982+
argument on the command line. The <replaceable>dbname</replaceable>
983+
can be a <link linkend="libpq-connstring">connection string</link>.
984+
If so, connection string parameters will override any conflicting
985+
command line options.
990986
</para>
991987
</listitem>
992988
</varlistentry>

‎doc/src/sgml/ref/pg_dumpall.sgml

Copy file name to clipboardExpand all lines: doc/src/sgml/ref/pg_dumpall.sgml
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -419,8 +419,9 @@ PostgreSQL documentation
419419
<term><option>--dbname=<replaceable class="parameter">connstr</replaceable></option></term>
420420
<listitem>
421421
<para>
422-
Specifies parameters used to connect to the server, as a connection
423-
string. See <xref linkend="libpq-connstring"> for more information.
422+
Specifies parameters used to connect to the server, as a <link
423+
linkend="libpq-connstring">connction string</link>; these
424+
will override any conflicting command line options.
424425
</para>
425426
<para>
426427
The option is called <literal>--dbname</> for consistency with other

‎doc/src/sgml/ref/pg_isready.sgml

Copy file name to clipboardExpand all lines: doc/src/sgml/ref/pg_isready.sgml
+5-9Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,11 @@ PostgreSQL documentation
4747
<term><option>--dbname=<replaceable class="parameter">dbname</replaceable></></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_recvlogical.sgml

Copy file name to clipboardExpand all lines: doc/src/sgml/ref/pg_recvlogical.sgml
+8-6Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -239,14 +239,16 @@ PostgreSQL documentation
239239

240240
<variablelist>
241241
<varlistentry>
242-
<term><option>-d <replaceable>database</replaceable></option></term>
243-
<term><option>--dbname=<replaceable>database</replaceable></option></term>
242+
<term><option>-d <replaceable>dbname</replaceable></option></term>
243+
<term><option>--dbname=<replaceable>dbname</replaceable></option></term>
244244
<listitem>
245245
<para>
246-
The database to connect to. See the description of the actions for
247-
what this means in detail. This can be a <application>libpq</application> connection string;
248-
see <xref linkend="LIBPQ-CONNSTRING"> for more information. Defaults
249-
to user name.
246+
The database to connect to. See the description
247+
of the actions for what this means in detail.
248+
The <replaceable>dbname</replaceable> can be a <link
249+
linkend="libpq-connstring">connection string</link>. If so,
250+
connection string parameters will override any conflicting
251+
command line options. Defaults to the user name.
250252
</para>
251253
</listitem>
252254
</varlistentry>

‎doc/src/sgml/ref/pg_restore.sgml

Copy file name to clipboardExpand all lines: doc/src/sgml/ref/pg_restore.sgml
+4-1Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,10 @@ PostgreSQL documentation
145145
<para>
146146
Connect to database <replaceable
147147
class="parameter">dbname</replaceable> and restore directly
148-
into the database.
148+
into the database. The <replaceable>dbname</replaceable> can
149+
be a <link linkend="libpq-connstring">connection string</link>.
150+
If so, connection string parameters will override any conflicting
151+
command line options.
149152
</para>
150153
</listitem>
151154
</varlistentry>

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

Copy file name to clipboardExpand all lines: doc/src/sgml/ref/psql-ref.sgml
+11-14Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -156,15 +156,10 @@ EOF
156156
Specifies the name of the database to connect to. This is
157157
equivalent to specifying <replaceable
158158
class="parameter">dbname</replaceable> as the first non-option
159-
argument on the command line.
160-
</para>
161-
<para>
162-
If this parameter contains an <symbol>=</symbol> sign or starts
163-
with a valid <acronym>URI</acronym> prefix
164-
(<literal>postgresql://</literal>
165-
or <literal>postgres://</literal>), it is treated as a
166-
<parameter>conninfo</parameter> string. See <xref
167-
linkend="libpq-connstring"> for more information.
159+
argument on the command line. The <replaceable>dbname</replaceable>
160+
can be a <link linkend="libpq-connstring">connection string</link>.
161+
If so, connection string parameters will override any conflicting
162+
command line options.
168163
</para>
169164
</listitem>
170165
</varlistentry>
@@ -477,7 +472,7 @@ EOF
477472
<listitem>
478473
<para>
479474
Never issue a password prompt. If the server requires password
480-
authentication and a password is not available by other means
475+
authentication and a password is not available from other sources
481476
such as a <filename>.pgpass</filename> file, the connection
482477
attempt will fail. This option can be useful in batch jobs and
483478
scripts where no user is present to enter a password.
@@ -497,13 +492,15 @@ EOF
497492
<listitem>
498493
<para>
499494
Force <application>psql</application> to prompt for a
500-
password before connecting to a database.
495+
password before connecting to a database, even if the password will
496+
not be used.
501497
</para>
502498

503499
<para>
504-
This option is never essential, since <application>psql</application>
505-
will automatically prompt for a password if the server demands
506-
password authentication. However, <application>psql</application>
500+
If the server requires password authentication and a password is not
501+
available from other sources such as a <filename>.pgpass</filename>
502+
file, <application>psql</application> will prompt for a
503+
password in any case. However, <application>psql</application>
507504
will waste a connection attempt finding out that the server wants a
508505
password. In some cases it is worth typing <option>-W</> to avoid
509506
the extra connection attempt.

‎doc/src/sgml/ref/reindexdb.sgml

Copy file name to clipboardExpand all lines: doc/src/sgml/ref/reindexdb.sgml
+4-1Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,10 @@ PostgreSQL documentation
128128
<option>--all</option>) is not used, the database name is read
129129
from the environment variable <envar>PGDATABASE</envar>. If
130130
that is not set, the user name specified for the connection is
131-
used.
131+
used. The <replaceable>dbname</replaceable> can be a <link
132+
linkend="libpq-connstring">connection string</link>. If so,
133+
connection string parameters will override any conflicting command
134+
line options.
132135
</para>
133136
</listitem>
134137
</varlistentry>

‎doc/src/sgml/ref/vacuumdb.sgml

Copy file name to clipboardExpand all lines: doc/src/sgml/ref/vacuumdb.sgml
+4-1Lines changed: 4 additions & 1 deletion
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.