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

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

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Bruce Momjian <bruce@momjian.us>
Cc: akos@elegran.com, pgsql-bugs@lists.postgresql.org
Date: 2018-01-29T18:01:09Z
Lists: pgsql-bugs
I wrote:
> So I now think the comment I added to do_connect() is unduly pessimistic,
> and it's fine to keep using "prompt_for_password(user)" for a forced
> password prompt there.  There may still be use-cases where it gets it
> wrong, but they're too narrow to be worth giving up the helpful prompt
> altogether.

After further thought about that I changed my mind again: it seems better
to be able to say "we never issue a misleading password prompt" than that
"it's right 99% of the time" --- and it looks like in some cases with
nondefault reuse_previous_specification, we'd still get it wrong.  So
I made it shorten the prompt if the dbname is a connstring or URI.
Committed with that change.

			regards, tom lane


Commits

  1. Avoid misleading psql password prompt when username is multiply specified.