Re: BUG #16746: [PG12.5 psql] Password ignored by connect meta-command

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: "David G. Johnston" <david.g.johnston@gmail.com>
Cc: kgradekx@gmail.com, PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Date: 2020-11-29T02:59:06Z
Lists: pgsql-bugs

Attachments

I wrote:
> Ugh... looks like I broke this in 85c54287a et al.  I had thought that
> this was the pre-existing behavior, but after further study I see that
> I was mistaken about how PQconnectdbParams() handles parameter
> replacement, so I misread what the prior code was really doing.

While I take full responsibility for having messed up here, I note that
the documentation for PQconnectdbParams is seriously misleading on the
point, in that it fails to point out that parameters appearing after
"dbname" will only override the connstring if they supply non-empty
values.  Besides that, it's rather in need of copy-editing, not to mention
some minimal thought about what is a reasonable order to make its points
in.  So I propose the attached docs fix to begin with.

			regards, tom lane

Commits

  1. Fix recently-introduced breakage in psql's \connect command.

  2. Doc: clarify behavior of PQconnectdbParams().

  3. Allow psql to re-use connection parameters after a connection loss.

  4. Clean up some unpleasant behaviors in psql's \connect command.

  5. Fix connection string handling in psql's \connect command.