pg.ddx.io pgsql-bugs@postgresql.org mailing list archive
help / color / mirror / Atom feedBUG #16486: Prompted password is ignored when password specified in connection string
17+ messages / 7 participants
[nested] [flat]
Commits from this thread:
2020-11-11 19fd4f20b6 b8b6a0124b 1393acb383 9fed2b5b2e efc306935d f93f1a21ae ceb883d2a3 doc: fix spelling "connction" to "connection"
2020-10-03 cf42550d51 3b8402170a d40a000036 65aa18e85a d2c9ef1c80 62f6f11d9e 1a9388bd0f doc: libpq connection options can override command-line flags
* BUG #16486: Prompted password is ignored when password specified in connection string
@ 2020-06-08 19:00 PG Bug reporting form <noreply@postgresql.org>
0 siblings, 1 reply; 17+ messages in thread
From: PG Bug reporting form @ 2020-06-08 19:00 UTC (permalink / raw)
To: pgsql-bugs@lists.postgresql.org; +Cc: exclusion@gmail.com
The following bug has been logged on the website:
Bug reference: 16486
Logged by: Alexander Lakhin
Email address: exclusion@gmail.com
PostgreSQL version: 13beta1
Operating system: Ubuntu 18.04
Description:
Assuming that we have the user u1 with the password p1, the following
command:
psql -U u1 'dbname=postgres password=p1' -W
prompts for a password but the input password is effectively ignored.
So if the connection string contains an invalid password:
psql -U u1 'dbname=postgres password=p2' -W
you can enter a valid password in a prompt, but still could not connect.
The documentation says:
PGPASSWORD behaves the same as the password connection parameter.
But in fact PGPASSWORD behaves differently . The following command:
PGPASSWORD="p1" psql -U u1 'dbname=postgres' -W
prompts for a password and fails if the password is wrong.
Similarly, if the environment variable contains an invalid password, it
still can be overridden with "-W".
^ permalink raw reply [nested|flat] 17+ messages in thread
* Re: BUG #16486: Prompted password is ignored when password specified in connection string
@ 2020-06-08 21:36 Tom Lane <tgl@sss.pgh.pa.us>
parent: PG Bug reporting form <noreply@postgresql.org>
0 siblings, 1 reply; 17+ messages in thread
From: Tom Lane @ 2020-06-08 21:36 UTC (permalink / raw)
To: exclusion@gmail.com; +Cc: pgsql-bugs@lists.postgresql.org
PG Bug reporting form <noreply@postgresql.org> writes:
> Assuming that we have the user u1 with the password p1, the following
> command:
> psql -U u1 'dbname=postgres password=p1' -W
> prompts for a password but the input password is effectively ignored.
The entire point of the -W switch is that it prompts whether or not
the password is going to be used for anything. If you don't like that,
don't use -W.
regards, tom lane
^ permalink raw reply [nested|flat] 17+ messages in thread
* Re: BUG #16486: Prompted password is ignored when password specified in connection string
@ 2020-06-08 22:08 David G. Johnston <david.g.johnston@gmail.com>
parent: Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 17+ messages in thread
From: David G. Johnston @ 2020-06-08 22:08 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: exclusion@gmail.com, PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
On Mon, Jun 8, 2020 at 2:36 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> PG Bug reporting form <noreply@postgresql.org> writes:
> > Assuming that we have the user u1 with the password p1, the following
> > command:
> > psql -U u1 'dbname=postgres password=p1' -W
> > prompts for a password but the input password is effectively ignored.
>
> The entire point of the -W switch is that it prompts whether or not
> the password is going to be used for anything. If you don't like that,
> don't use -W.
>
A more intuitive interpretation of -W is that it prompts for a password,
regardless of valid values being provided by other configuration, and uses
that password exclusively to attempt to connect to the server.
The documentation doesn't actually say which one of those two
interpretations is correct.
And regardless of which interpretation is intended the OP seems to
demonstrate that either interpretation is reality depending on
which combination of configuration sources provide the non-prompted
password. That inconsistency seems undesirable.
David J.
^ permalink raw reply [nested|flat] 17+ messages in thread
* Re: BUG #16486: Prompted password is ignored when password specified in connection string
@ 2020-06-08 22:27 Tom Lane <tgl@sss.pgh.pa.us>
parent: David G. Johnston <david.g.johnston@gmail.com>
0 siblings, 1 reply; 17+ messages in thread
From: Tom Lane @ 2020-06-08 22:27 UTC (permalink / raw)
To: David G. Johnston <david.g.johnston@gmail.com>; +Cc: exclusion@gmail.com, PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
"David G. Johnston" <david.g.johnston@gmail.com> writes:
> On Mon, Jun 8, 2020 at 2:36 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> The entire point of the -W switch is that it prompts whether or not
>> the password is going to be used for anything.
> A more intuitive interpretation of -W is that it prompts for a password,
> regardless of valid values being provided by other configuration, and uses
> that password exclusively to attempt to connect to the server.
> The documentation doesn't actually say which one of those two
> interpretations is correct.
Hmm ... I had thought that the docs explained -W in more or less the same
way I did above, but I see that (at least on the psql page) things are
indeed pretty vague. I'll see about improving that.
regards, tom lane
^ permalink raw reply [nested|flat] 17+ messages in thread
* Re: BUG #16486: Prompted password is ignored when password specified in connection string
@ 2020-06-09 01:59 Tom Lane <tgl@sss.pgh.pa.us>
parent: Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 3 replies; 17+ messages in thread
From: Tom Lane @ 2020-06-09 01:59 UTC (permalink / raw)
To: David G. Johnston <david.g.johnston@gmail.com>; +Cc: exclusion@gmail.com, PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
I wrote:
> "David G. Johnston" <david.g.johnston@gmail.com> writes:
>> On Mon, Jun 8, 2020 at 2:36 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>>> The entire point of the -W switch is that it prompts whether or not
>>> the password is going to be used for anything.
>> A more intuitive interpretation of -W is that it prompts for a password,
>> regardless of valid values being provided by other configuration, and uses
>> that password exclusively to attempt to connect to the server.
>> The documentation doesn't actually say which one of those two
>> interpretations is correct.
> Hmm ... I had thought that the docs explained -W in more or less the same
> way I did above, but I see that (at least on the psql page) things are
> indeed pretty vague. I'll see about improving that.
Concretely, it looks like we need edits as attached for psql, and
likewise for all our other programs with similar options.
The thing that was really missing here IMO is the specification that a
conninfo string overrides other command-line parameters. It's somewhat
debatable whether a -W prompt is a "command line parameter", but it
acts that way for this purpose. In any case, I'm disinclined to document
that specific interaction, because it would amount to blessing a pretty
damfool practice, which is to make your password visible on the program's
command line. (I wonder whether section 33.1.2 ought to specifically
caution against putting passwords into command-line conninfo strings.)
regards, tom lane
Attachments:
wip-password-doc.patch (text/x-diff, 2.0K) download
diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index 42e862cf17..816406235f 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -177,6 +177,8 @@ EOF
or <literal>postgres://</literal>), it is treated as a
<parameter>conninfo</parameter> string. See <xref
linkend="libpq-connstring"/> for more information.
+ Connection parameters found in the <parameter>conninfo</parameter>
+ string will override other options such as <option>--username</option>.
</para>
</listitem>
</varlistentry>
@@ -498,7 +500,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.
@@ -518,13 +520,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.
^ permalink raw reply [nested|flat] 17+ messages in thread
* Re: BUG #16486: Prompted password is ignored when password specified in connection string
@ 2020-06-09 03:03 David G. Johnston <david.g.johnston@gmail.com>
parent: Tom Lane <tgl@sss.pgh.pa.us>
2 siblings, 0 replies; 17+ messages in thread
From: David G. Johnston @ 2020-06-09 03:03 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: exclusion@gmail.com, PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
On Mon, Jun 8, 2020 at 6:59 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> I wrote:
> > "David G. Johnston" <david.g.johnston@gmail.com> writes:
> >> On Mon, Jun 8, 2020 at 2:36 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> >>> The entire point of the -W switch is that it prompts whether or not
> >>> the password is going to be used for anything.
>
> >> A more intuitive interpretation of -W is that it prompts for a password,
> >> regardless of valid values being provided by other configuration, and
> uses
> >> that password exclusively to attempt to connect to the server.
> >> The documentation doesn't actually say which one of those two
> >> interpretations is correct.
>
> > Hmm ... I had thought that the docs explained -W in more or less the same
> > way I did above, but I see that (at least on the psql page) things are
> > indeed pretty vague. I'll see about improving that.
>
> Concretely, it looks like we need edits as attached for psql, and
> likewise for all our other programs with similar options.
>
For my own understanding if nothing else. The proposal requires the reader
to infer the following reality (if this is documented succinctly somewhere
I haven't stumbled across it):
There are 5 sources of passwords:
conninfo (cli, service file, URI)
-W
PGPASSWORD
.pgpass
fallback prompt
The first one to provide a non-empty password value is attempted and either
succeeds or fails - subsequent sources are not considered upon failure.
The thing that was really missing here IMO is the specification that a
> conninfo string overrides other command-line parameters.
To confirm, the service file is treated no differently than specifying
these directly on a command line.
It's somewhat
> debatable whether a -W prompt is a "command line parameter", but it
> acts that way for this purpose.
Makes sense, it is a "key/value" parameter just that the value comes from
stdin instead of the command itself.
> In any case, I'm disinclined to document
> that specific interaction, because it would amount to blessing a pretty
> damfool practice, which is to make your password visible on the program's
> command line.
(I wonder whether section 33.1.2 ought to specifically
> caution against putting passwords into command-line conninfo strings.)
>
Except it doesn't if it's coming from a service file or injected using an
environment variable supplied URI, right?
I'd rather document how it works and describe why it should be avoided.
There aren't many complaints/questions in this area so probably a wholesale
reworking and centralization is not worth the effort.
I suppose my final answer for the wording (assuming I understand this
correctly) would be:
"If you specify -W and conninfo does not supply a password the password
entered here will be used regardless of whether other sources supply a
password. If conninfo supplies a password psql will still prompt you for
one but will ignore it." (reworded to avoid "you"...)
David J.
^ permalink raw reply [nested|flat] 17+ messages in thread
* Re: BUG #16486: Prompted password is ignored when password specified in connection string
@ 2020-06-09 04:00 Alexander Lakhin <exclusion@gmail.com>
parent: Tom Lane <tgl@sss.pgh.pa.us>
2 siblings, 0 replies; 17+ messages in thread
From: Alexander Lakhin @ 2020-06-09 04:00 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; David G. Johnston <david.g.johnston@gmail.com>; +Cc: PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Hello Tom,
09.06.2020 04:59, Tom Lane wrote:
> The thing that was really missing here IMO is the specification that a
> conninfo string overrides other command-line parameters. It's somewhat
> debatable whether a -W prompt is a "command line parameter", but it
> acts that way for this purpose. In any case, I'm disinclined to document
> that specific interaction, because it would amount to blessing a pretty
> damfool practice, which is to make your password visible on the program's
> command line. (I wonder whether section 33.1.2 ought to specifically
> caution against putting passwords into command-line conninfo strings.)
I don't think that the main issue is with blessing such a practice,
because the documentation already says about PGPASSWORD:
Use of this environment variable is not recommended for security
reasons, as some operating systems allow non-root users to see process
environment variables via ps; ...
So using the PGPASSWORD is not blessed either.
And I wonder, what if we had, say PGCONNURI environment variable? Should
the password specified inside be not overridable too?
By the way, similar behaviour could also be observed with PGSERVICE:
echo -e "[mydb]\nhost=localhost\nuser=u1\npassword=p1\n" >/tmp/service.conf
PGSERVICEFILE=/tmp/service.conf PGSERVICE="mydb" psql -W
In this case psql effectively ignores the input password too. So the
visibility of the password is not main criteria to make it dominant.
Best regards,
Alexander
^ permalink raw reply [nested|flat] 17+ messages in thread
* Re: BUG #16486: Prompted password is ignored when password specified in connection string
@ 2020-09-01 20:38 Bruce Momjian <bruce@momjian.us>
parent: Tom Lane <tgl@sss.pgh.pa.us>
2 siblings, 2 replies; 17+ messages in thread
From: Bruce Momjian @ 2020-09-01 20:38 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: David G. Johnston <david.g.johnston@gmail.com>; exclusion@gmail.com, PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
On Mon, Jun 8, 2020 at 09:59:18PM -0400, Tom Lane wrote:
> I wrote:
> > Hmm ... I had thought that the docs explained -W in more or less the same
> > way I did above, but I see that (at least on the psql page) things are
> > indeed pretty vague. I'll see about improving that.
>
> Concretely, it looks like we need edits as attached for psql, and
> likewise for all our other programs with similar options.
>
> The thing that was really missing here IMO is the specification that a
> conninfo string overrides other command-line parameters. It's somewhat
> debatable whether a -W prompt is a "command line parameter", but it
> acts that way for this purpose. In any case, I'm disinclined to document
> that specific interaction, because it would amount to blessing a pretty
> damfool practice, which is to make your password visible on the program's
> command line. (I wonder whether section 33.1.2 ought to specifically
> caution against putting passwords into command-line conninfo strings.)
I used a later version of Tom's patch to add documentation of how
connection strings can override command-line options, plus it has the
password description improvements.
I would like to apply this to all supported versions.
--
Bruce Momjian <bruce@momjian.us> https://momjian.us
EnterpriseDB https://enterprisedb.com
The usefulness of a cup is in its emptiness, Bruce Lee
Attachments:
passwd.diff (text/x-diff, 10.9K) download
diff --git a/doc/src/sgml/ref/clusterdb.sgml b/doc/src/sgml/ref/clusterdb.sgml
index 177856ca74..3049c915bb 100644
--- a/doc/src/sgml/ref/clusterdb.sgml
+++ b/doc/src/sgml/ref/clusterdb.sgml
@@ -95,7 +95,9 @@ 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. <link linkend="libpq-connstring">Connction strings</link>
+ can also be used for connection specifications, and these can
+ override other 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 aa0b27c9f3..19c7d098b9 100644
--- a/doc/src/sgml/ref/pg_basebackup.sgml
+++ b/doc/src/sgml/ref/pg_basebackup.sgml
@@ -653,8 +653,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 strings</link>; these
+ can override other command-line options.
</para>
<para>
The option is called <literal>--dbname</literal> for consistency with other
diff --git a/doc/src/sgml/ref/pg_dump.sgml b/doc/src/sgml/ref/pg_dump.sgml
index 0b2e2de87b..f4b209af83 100644
--- a/doc/src/sgml/ref/pg_dump.sgml
+++ b/doc/src/sgml/ref/pg_dump.sgml
@@ -1130,14 +1130,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. <link
+ linkend="libpq-connstring">Connction strings</link> can also be
+ used for connection specifications, and these can override other
+ 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 43abc530a0..e7868091b9 100644
--- a/doc/src/sgml/ref/pg_dumpall.sgml
+++ b/doc/src/sgml/ref/pg_dumpall.sgml
@@ -550,8 +550,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 strings</link>; these
+ can override other command-line options.
</para>
<para>
The option is called <literal>--dbname</literal> for consistency with other
diff --git a/doc/src/sgml/ref/pg_isready.sgml b/doc/src/sgml/ref/pg_isready.sgml
index 3d5b551b87..63ef1d785a 100644
--- a/doc/src/sgml/ref/pg_isready.sgml
+++ b/doc/src/sgml/ref/pg_isready.sgml
@@ -47,15 +47,10 @@ 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. <link
+ linkend="libpq-connstring">Connction strings</link> can also be
+ used for connection specifications, and these can override other
+ 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 865ec84262..76d2ba48fa 100644
--- a/doc/src/sgml/ref/pg_receivewal.sgml
+++ b/doc/src/sgml/ref/pg_receivewal.sgml
@@ -252,8 +252,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 strings</link>; these
+ can override other command-line options.
</para>
<para>
The option is called <literal>--dbname</literal> for consistency with other
diff --git a/doc/src/sgml/ref/pg_recvlogical.sgml b/doc/src/sgml/ref/pg_recvlogical.sgml
index 41508fdc1e..a9651b0921 100644
--- a/doc/src/sgml/ref/pg_recvlogical.sgml
+++ b/doc/src/sgml/ref/pg_recvlogical.sgml
@@ -277,10 +277,11 @@ PostgreSQL documentation
<term><option>--dbname=<replaceable>database</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. <link
+ linkend="libpq-connstring">Connction strings</link> can also
+ be used for connection specifications, and these can override
+ other 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 27eab2f02a..a4f2ee9f43 100644
--- a/doc/src/sgml/ref/pg_restore.sgml
+++ b/doc/src/sgml/ref/pg_restore.sgml
@@ -156,7 +156,9 @@ PostgreSQL documentation
<para>
Connect to database <replaceable
class="parameter">dbname</replaceable> and restore directly
- into the database.
+ into the database. <link linkend="libpq-connstring">Connction
+ strings</link> can also be used for connection specifications,
+ and these can override other 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 201946990f..b9a0ab245a 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -168,15 +168,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. <link
+ linkend="libpq-connstring">Connction strings</link> can also be
+ used for connection specifications, and these can override other
+ command-line options.
</para>
</listitem>
</varlistentry>
@@ -498,7 +493,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.
@@ -518,13 +513,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.
diff --git a/doc/src/sgml/ref/reindexdb.sgml b/doc/src/sgml/ref/reindexdb.sgml
index 026fd018d9..f8e27d82c2 100644
--- a/doc/src/sgml/ref/reindexdb.sgml
+++ b/doc/src/sgml/ref/reindexdb.sgml
@@ -139,7 +139,9 @@ 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. <link linkend="libpq-connstring">Connction strings</link>
+ can also be used for connection specifications, and these can
+ override other command-line options.
</para>
</listitem>
</varlistentry>
diff --git a/doc/src/sgml/ref/vacuumdb.sgml b/doc/src/sgml/ref/vacuumdb.sgml
index 95d6894cb0..04975656bb 100644
--- a/doc/src/sgml/ref/vacuumdb.sgml
+++ b/doc/src/sgml/ref/vacuumdb.sgml
@@ -97,7 +97,9 @@ 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. <link linkend="libpq-connstring">Connction strings</link>
+ can also be used for connection specifications, and these can
+ override other command-line options.
</para>
</listitem>
</varlistentry>
^ permalink raw reply [nested|flat] 17+ messages in thread
* Re: BUG #16486: Prompted password is ignored when password specified in connection string
@ 2020-09-02 07:54 Oleksandr Shulgin <oleksandr.shulgin@zalando.de>
parent: Bruce Momjian <bruce@momjian.us>
1 sibling, 1 reply; 17+ messages in thread
From: Oleksandr Shulgin @ 2020-09-02 07:54 UTC (permalink / raw)
To: Bruce Momjian <bruce@momjian.us>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; David G. Johnston <david.g.johnston@gmail.com>; exclusion@gmail.com, PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
On Tue, Sep 1, 2020 at 10:38 PM Bruce Momjian <bruce@momjian.us> wrote:
>
> I used a later version of Tom's patch to add documentation of how
> connection strings can override command-line options, plus it has the
> password description improvements.
>
> I would like to apply this to all supported versions.
>
Not related to the proposed change, this sentence is the same before and
after, but makes me wonder:
> 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.
AFAIK, there is nothing in the protocol that forces psql to make an extra
connection attempt. If libpq provided a means to pass a password-prompt
callback, no extra connection would be needed I think?
Regards,
--
Alex
^ permalink raw reply [nested|flat] 17+ messages in thread
* Re: BUG #16486: Prompted password is ignored when password specified in connection string
@ 2020-09-02 13:18 Bruce Momjian <bruce@momjian.us>
parent: Oleksandr Shulgin <oleksandr.shulgin@zalando.de>
0 siblings, 1 reply; 17+ messages in thread
From: Bruce Momjian @ 2020-09-02 13:18 UTC (permalink / raw)
To: Oleksandr Shulgin <oleksandr.shulgin@zalando.de>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; David G. Johnston <david.g.johnston@gmail.com>; exclusion@gmail.com, PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
On Wed, Sep 2, 2020 at 09:54:37AM +0200, Oleksandr Shulgin wrote:
> On Tue, Sep 1, 2020 at 10:38 PM Bruce Momjian <bruce@momjian.us> wrote:
>
>
> I used a later version of Tom's patch to add documentation of how
> connection strings can override command-line options, plus it has the
> password description improvements.
>
> I would like to apply this to all supported versions.
>
>
> Not related to the proposed change, this sentence is the same before and after,
> but makes me wonder:
>
> > 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.
>
> AFAIK, there is nothing in the protocol that forces psql to make an extra
> connection attempt. If libpq provided a means to pass a password-prompt
> callback, no extra connection would be needed I think?
That is true. I don't think we want the backend to be kept open waiting
for someone to type a password, which is why, I think, we don't do it
that way.
--
Bruce Momjian <bruce@momjian.us> https://momjian.us
EnterpriseDB https://enterprisedb.com
The usefulness of a cup is in its emptiness, Bruce Lee
^ permalink raw reply [nested|flat] 17+ messages in thread
* Re: BUG #16486: Prompted password is ignored when password specified in connection string
@ 2020-09-02 14:46 Tom Lane <tgl@sss.pgh.pa.us>
parent: Bruce Momjian <bruce@momjian.us>
0 siblings, 0 replies; 17+ messages in thread
From: Tom Lane @ 2020-09-02 14:46 UTC (permalink / raw)
To: Bruce Momjian <bruce@momjian.us>; +Cc: Oleksandr Shulgin <oleksandr.shulgin@zalando.de>; David G. Johnston <david.g.johnston@gmail.com>; exclusion@gmail.com, PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Bruce Momjian <bruce@momjian.us> writes:
> On Wed, Sep 2, 2020 at 09:54:37AM +0200, Oleksandr Shulgin wrote:
>> AFAIK, there is nothing in the protocol that forces psql to make an extra
>> connection attempt. If libpq provided a means to pass a password-prompt
>> callback, no extra connection would be needed I think?
> That is true. I don't think we want the backend to be kept open waiting
> for someone to type a password, which is why, I think, we don't do it
> that way.
Yeah, I think this is an ancient value judgement. Sure, it's pretty
questionable whether spawning a backend a second time is better than
tying one up waiting for a human to type a password. (It's going to
be spending a lot of time waiting for that human later on, anyway.)
The real point IMO is that libpq's connection API is already
unreasonably complicated, and providing a callback of this sort
would make it even messier. A different client library might make
a different choice, perhaps.
regards, tom lane
^ permalink raw reply [nested|flat] 17+ messages in thread
* Re: BUG #16486: Prompted password is ignored when password specified in connection string
@ 2020-09-02 19:47 Tom Lane <tgl@sss.pgh.pa.us>
parent: Bruce Momjian <bruce@momjian.us>
1 sibling, 1 reply; 17+ messages in thread
From: Tom Lane @ 2020-09-02 19:47 UTC (permalink / raw)
To: Bruce Momjian <bruce@momjian.us>; +Cc: David G. Johnston <david.g.johnston@gmail.com>; exclusion@gmail.com, PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Bruce Momjian <bruce@momjian.us> writes:
> I used a later version of Tom's patch to add documentation of how
> connection strings can override command-line options, plus it has the
> password description improvements.
> <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. <link linkend="libpq-connstring">Connction strings</link>
> + can also be used for connection specifications, and these can
> + override other command-line options.
> </para>
> </listitem>
> </varlistentry>
* Spellcheck (not "Connction" please)
* I do not like the wording "can override", because that's just impossibly
vague. It leaves the reader wondering whether there are cases where that
doesn't happen.
I'd suggest wording more like
The <replaceable>dbname</replaceable> can be a
<link ...>connection string</link>. If so, connection parameters
found in the connection string will override any conflicting command
line options, such as <option>--username</option>.
regards, tom lane
^ permalink raw reply [nested|flat] 17+ messages in thread
* Re: BUG #16486: Prompted password is ignored when password specified in connection string
@ 2020-09-03 19:05 Bruce Momjian <bruce@momjian.us>
parent: Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 2 replies; 17+ messages in thread
From: Bruce Momjian @ 2020-09-03 19:05 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: David G. Johnston <david.g.johnston@gmail.com>; exclusion@gmail.com, PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
On Wed, Sep 2, 2020 at 03:47:40PM -0400, Tom Lane wrote:
> Bruce Momjian <bruce@momjian.us> writes:
> > I used a later version of Tom's patch to add documentation of how
> > connection strings can override command-line options, plus it has the
> > password description improvements.
>
> > <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. <link linkend="libpq-connstring">Connction strings</link>
> > + can also be used for connection specifications, and these can
> > + override other command-line options.
> > </para>
> > </listitem>
> > </varlistentry>
>
> * Spellcheck (not "Connction" please)
>
> * I do not like the wording "can override", because that's just impossibly
> vague. It leaves the reader wondering whether there are cases where that
> doesn't happen.
>
> I'd suggest wording more like
>
> The <replaceable>dbname</replaceable> can be a
> <link ...>connection string</link>. If so, connection parameters
> found in the connection string will override any conflicting command
> line options, such as <option>--username</option>.
Sure, makes sense. Updated patch attached.
--
Bruce Momjian <bruce@momjian.us> https://momjian.us
EnterpriseDB https://enterprisedb.com
The usefulness of a cup is in its emptiness, Bruce Lee
Attachments:
passwd.diff (text/x-diff, 11.5K) download
diff --git a/doc/src/sgml/ref/clusterdb.sgml b/doc/src/sgml/ref/clusterdb.sgml
index 177856ca74..c53bacf864 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 aa0b27c9f3..6fae2fcc55 100644
--- a/doc/src/sgml/ref/pg_basebackup.sgml
+++ b/doc/src/sgml/ref/pg_basebackup.sgml
@@ -653,8 +653,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
diff --git a/doc/src/sgml/ref/pg_dump.sgml b/doc/src/sgml/ref/pg_dump.sgml
index 0b2e2de87b..107d47354a 100644
--- a/doc/src/sgml/ref/pg_dump.sgml
+++ b/doc/src/sgml/ref/pg_dump.sgml
@@ -1130,14 +1130,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 43abc530a0..4645e3820a 100644
--- a/doc/src/sgml/ref/pg_dumpall.sgml
+++ b/doc/src/sgml/ref/pg_dumpall.sgml
@@ -550,8 +550,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
diff --git a/doc/src/sgml/ref/pg_isready.sgml b/doc/src/sgml/ref/pg_isready.sgml
index 3d5b551b87..ba25ca65a4 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></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>
diff --git a/doc/src/sgml/ref/pg_receivewal.sgml b/doc/src/sgml/ref/pg_receivewal.sgml
index 865ec84262..26a66c0e19 100644
--- a/doc/src/sgml/ref/pg_receivewal.sgml
+++ b/doc/src/sgml/ref/pg_receivewal.sgml
@@ -252,8 +252,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
diff --git a/doc/src/sgml/ref/pg_recvlogical.sgml b/doc/src/sgml/ref/pg_recvlogical.sgml
index 41508fdc1e..6b1d98d06e 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 27eab2f02a..72f2144c02 100644
--- a/doc/src/sgml/ref/pg_restore.sgml
+++ b/doc/src/sgml/ref/pg_restore.sgml
@@ -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>
diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index e1e2236a71..37c563bee7 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -168,15 +168,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>
@@ -498,7 +493,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.
@@ -518,13 +513,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.
diff --git a/doc/src/sgml/ref/reindexdb.sgml b/doc/src/sgml/ref/reindexdb.sgml
index 026fd018d9..6ea3bdff1f 100644
--- a/doc/src/sgml/ref/reindexdb.sgml
+++ b/doc/src/sgml/ref/reindexdb.sgml
@@ -139,7 +139,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 95d6894cb0..3f3d15bb53 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>
^ permalink raw reply [nested|flat] 17+ messages in thread
* Re: BUG #16486: Prompted password is ignored when password specified in connection string
@ 2020-09-15 01:59 David G. Johnston <david.g.johnston@gmail.com>
parent: Bruce Momjian <bruce@momjian.us>
1 sibling, 0 replies; 17+ messages in thread
From: David G. Johnston @ 2020-09-15 01:59 UTC (permalink / raw)
To: Bruce Momjian <bruce@momjian.us>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; exclusion@gmail.com, PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
On Thu, Sep 3, 2020 at 12:05 PM Bruce Momjian <bruce@momjian.us> wrote:
> > I'd suggest wording more like
> >
> > The <replaceable>dbname</replaceable> can be a
> > <link ...>connection string</link>. If so, connection parameters
> > found in the connection string will override any conflicting command
> > line options, such as <option>--username</option>.
>
> Sure, makes sense. Updated patch attached.
>
I read through the patch and it looks good to me.
David J.
^ permalink raw reply [nested|flat] 17+ messages in thread
* Re: BUG #16486: Prompted password is ignored when password specified in connection string
@ 2020-10-03 02:19 Bruce Momjian <bruce@momjian.us>
parent: Bruce Momjian <bruce@momjian.us>
1 sibling, 1 reply; 17+ messages in thread
From: Bruce Momjian @ 2020-10-03 02:19 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: David G. Johnston <david.g.johnston@gmail.com>; exclusion@gmail.com, PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
On Thu, Sep 3, 2020 at 03:05:38PM -0400, Bruce Momjian wrote:
> On Wed, Sep 2, 2020 at 03:47:40PM -0400, Tom Lane wrote:
> > Bruce Momjian <bruce@momjian.us> writes:
> > > I used a later version of Tom's patch to add documentation of how
> > > connection strings can override command-line options, plus it has the
> > > password description improvements.
> >
> > > <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. <link linkend="libpq-connstring">Connction strings</link>
> > > + can also be used for connection specifications, and these can
> > > + override other command-line options.
> > > </para>
> > > </listitem>
> > > </varlistentry>
> >
> > * Spellcheck (not "Connction" please)
> >
> > * I do not like the wording "can override", because that's just impossibly
> > vague. It leaves the reader wondering whether there are cases where that
> > doesn't happen.
> >
> > I'd suggest wording more like
> >
> > The <replaceable>dbname</replaceable> can be a
> > <link ...>connection string</link>. If so, connection parameters
> > found in the connection string will override any conflicting command
> > line options, such as <option>--username</option>.
>
> Sure, makes sense. Updated patch attached.
Patch applied to all supported versions; thanks for the report.
--
Bruce Momjian <bruce@momjian.us> https://momjian.us
EnterpriseDB https://enterprisedb.com
The usefulness of a cup is in its emptiness, Bruce Lee
^ permalink raw reply [nested|flat] 17+ messages in thread
* Re: BUG #16486: Prompted password is ignored when password specified in connection string
@ 2020-11-02 06:33 Justin Pryzby <pryzby@telsasoft.com>
parent: Bruce Momjian <bruce@momjian.us>
0 siblings, 1 reply; 17+ messages in thread
From: Justin Pryzby @ 2020-11-02 06:33 UTC (permalink / raw)
To: Bruce Momjian <bruce@momjian.us>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; David G. Johnston <david.g.johnston@gmail.com>; exclusion@gmail.com; pgsql-bugs@lists.postgresql.org
On Fri, Oct 02, 2020 at 10:19:58PM -0400, Bruce Momjian wrote:
> On Thu, Sep 3, 2020 at 03:05:38PM -0400, Bruce Momjian wrote:
> > On Wed, Sep 2, 2020 at 03:47:40PM -0400, Tom Lane wrote:
> > > Bruce Momjian <bruce@momjian.us> writes:
> > > > I used a later version of Tom's patch to add documentation of how
> > > > connection strings can override command-line options, plus it has the
> > > > password description improvements.
> > >
> > > > <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. <link linkend="libpq-connstring">Connction strings</link>
> > > > + can also be used for connection specifications, and these can
> > > > + override other command-line options.
> > > > </para>
> > > > </listitem>
> > > > </varlistentry>
> > >
> > > * Spellcheck (not "Connction" please)
...
> > Sure, makes sense. Updated patch attached.
>
> Patch applied to all supported versions; thanks for the report.
Unfortunately that included the typo Tom pointed out :(
^ permalink raw reply [nested|flat] 17+ messages in thread
* Re: BUG #16486: Prompted password is ignored when password specified in connection string
@ 2020-11-11 00:18 Bruce Momjian <bruce@momjian.us>
parent: Justin Pryzby <pryzby@telsasoft.com>
0 siblings, 0 replies; 17+ messages in thread
From: Bruce Momjian @ 2020-11-11 00:18 UTC (permalink / raw)
To: Justin Pryzby <pryzby@telsasoft.com>; +Cc: Tom Lane <tgl@sss.pgh.pa.us>; David G. Johnston <david.g.johnston@gmail.com>; exclusion@gmail.com; pgsql-bugs@lists.postgresql.org
On Mon, Nov 2, 2020 at 12:33:33AM -0600, Justin Pryzby wrote:
> On Fri, Oct 02, 2020 at 10:19:58PM -0400, Bruce Momjian wrote:
> > On Thu, Sep 3, 2020 at 03:05:38PM -0400, Bruce Momjian wrote:
> > > On Wed, Sep 2, 2020 at 03:47:40PM -0400, Tom Lane wrote:
> > > > Bruce Momjian <bruce@momjian.us> writes:
> > > > > I used a later version of Tom's patch to add documentation of how
> > > > > connection strings can override command-line options, plus it has the
> > > > > password description improvements.
> > > >
> > > > > <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. <link linkend="libpq-connstring">Connction strings</link>
> > > > > + can also be used for connection specifications, and these can
> > > > > + override other command-line options.
> > > > > </para>
> > > > > </listitem>
> > > > > </varlistentry>
> > > >
> > > > * Spellcheck (not "Connction" please)
> ...
> > > Sure, makes sense. Updated patch attached.
> >
> > Patch applied to all supported versions; thanks for the report.
>
> Unfortunately that included the typo Tom pointed out :(
Oops, I missed that. Fixed, thanks.
--
Bruce Momjian <bruce@momjian.us> https://momjian.us
EnterpriseDB https://enterprisedb.com
The usefulness of a cup is in its emptiness, Bruce Lee
^ permalink raw reply [nested|flat] 17+ messages in thread
end of thread, other threads:[~2020-11-11 00:18 UTC | newest]
Thread overview: 17+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-06-08 19:00 BUG #16486: Prompted password is ignored when password specified in connection string PG Bug reporting form <noreply@postgresql.org>
2020-06-08 21:36 ` Tom Lane <tgl@sss.pgh.pa.us>
2020-06-08 22:08 ` David G. Johnston <david.g.johnston@gmail.com>
2020-06-08 22:27 ` Tom Lane <tgl@sss.pgh.pa.us>
2020-06-09 01:59 ` Tom Lane <tgl@sss.pgh.pa.us>
2020-06-09 03:03 ` David G. Johnston <david.g.johnston@gmail.com>
2020-06-09 04:00 ` Alexander Lakhin <exclusion@gmail.com>
2020-09-01 20:38 ` Bruce Momjian <bruce@momjian.us>
2020-09-02 07:54 ` Oleksandr Shulgin <oleksandr.shulgin@zalando.de>
2020-09-02 13:18 ` Bruce Momjian <bruce@momjian.us>
2020-09-02 14:46 ` Tom Lane <tgl@sss.pgh.pa.us>
2020-09-02 19:47 ` Tom Lane <tgl@sss.pgh.pa.us>
2020-09-03 19:05 ` Bruce Momjian <bruce@momjian.us>
2020-09-15 01:59 ` David G. Johnston <david.g.johnston@gmail.com>
2020-10-03 02:19 ` Bruce Momjian <bruce@momjian.us>
2020-11-02 06:33 ` Justin Pryzby <pryzby@telsasoft.com>
2020-11-11 00:18 ` Bruce Momjian <bruce@momjian.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox