psql patch for displaying the username when asking password

From: Adrian Maier <adrian(dot)maier(at)gmail(dot)com>
To: pgsql-patches(at)postgresql(dot)org
Subject: psql patch for displaying the username when asking password
Date: 2005-06-30 07:34:51
Message-ID: cd30ef8c050630003428301fb3@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 Content-Type Size
psql_password_prompt.diff text/x-patch 3.5 KB

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Peter Eisentraut 2005-06-30 08:41:36 Re: psql patch for displaying the username when asking password
Previous Message Satoshi Nagayasu 2005-06-30 06:47:52 Re: Open items