BUG #15025: PSQL CLI - inconsistency when both -d and -U supplies a username

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: akos(at)elegran(dot)com
Subject: BUG #15025: PSQL CLI - inconsistency when both -d and -U supplies a username
Date: 2018-01-23 13:00:13
Message-ID: 20180123130013.7407.24749@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 15025
Logged by: Akos Vandra
Email address: akos(at)elegran(dot)com
PostgreSQL version: 9.5.4
Operating system: Debian
Description:

Repro:

case 1: psql -U other_user -d "postgresql://some_user(at)host/db"

case 2: psql -d "postgresql://some_user(at)host/db" -U other_user

Expectation:

Use whatever is given later:

case 1: log in as user
case 2: log in as other_user

Actual:

case 1: logs in as user
case 2:
- the password prompt asks for the pw of user
- psql uses the password given to log in with other_user
- if the pw is correct for user, or incorrect it displays that the
password is incorrect for other_user
- if the password is correct for other_user, it connects to the db as
other_user

$ psql "postgresql://user(at)host/db" -U other_user
Password for user other_user:
psql: FATAL: password authentication failed for user "user"
FATAL: password authentication failed for user "user"

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Rainer Orth 2018-01-23 15:45:50 Conflicting declarations for b64_encode etc. on Solaris 11.4 Beta
Previous Message JOSEPH Michel (EXT AMARIS) 2018-01-23 11:04:43 RE: Problem running post-install step.