PostgreSQL Bugs

Collected from the PG bugs email list.

Bug ID16486
PG Version13beta1
OSUbuntu 18.04
Opened2020-06-08 19:00:06+00
Reported byAlexander Lakhin
StatusNew

Body of first available message related to this bug follows.

The following bug has been logged on the website:

Bug reference:      16486
Logged by:          Alexander Lakhin
Email address:      (redacted)
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".

Messages

DateAuthorSubject
2020-06-08 19:00:06+00PG Bug reporting formBUG #16486: Prompted password is ignored when password specified in connection string
2020-06-08 21:36:39+00Tom LaneRe: BUG #16486: Prompted password is ignored when password specified in connection string
2020-06-08 22:08:48+00"David G(dot) Johnston"Re: BUG #16486: Prompted password is ignored when password specified in connection string
2020-06-08 22:27:06+00Tom LaneRe: BUG #16486: Prompted password is ignored when password specified in connection string
2020-06-09 01:59:18+00Tom LaneRe: BUG #16486: Prompted password is ignored when password specified in connection string
2020-06-09 03:03:41+00"David G(dot) Johnston"Re: BUG #16486: Prompted password is ignored when password specified in connection string
2020-06-09 04:00:01+00Alexander LakhinRe: BUG #16486: Prompted password is ignored when password specified in connection string