psql patch for displaying the username when asking password - Mailing list pgsql-patches

From Adrian Maier
Subject psql patch for displaying the username when asking password
Date
Msg-id cd30ef8c050630003428301fb3@mail.gmail.com
Whole thread Raw
Responses Re: psql patch for displaying the username when asking password
List pgsql-patches
Hello all,

The attached patch modifies the message displayed by psql
when asking the password "Password: "
to include the username as well:  "Password for user postgres : ".

Displaying the username is useful when running sql scripts
which are setting the session authorization (like the dump scripts
generated by older versions of pg_dump) and you don't have all the
usernames/passwords in ~/.pgpass.
In such cases it can happen that psql is asking several times :
Password:
Password:
Password:
Password:

and you don't know whether it's asking the pasword of the 'postgres' user
or the password of user that is importing the data .

I have the feeling that asking for "Password:" several times no longer
happens when running scripts generated by recent versions of pg_dump.
However, the patch might be useful for people who are upgrading .


Cheers,
Adrian Maier

Attachment

pgsql-patches by date:

Previous
From: "Matthew T. O'Connor"
Date:
Subject: Re: Autovacuum integration patch
Next
From: Peter Eisentraut
Date:
Subject: Re: psql patch for displaying the username when asking password