Re: psql patch for displaying the username when asking password

Lists: pgsql-patches
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
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

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Adrian Maier <adrian(dot)maier(at)gmail(dot)com>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: psql patch for displaying the username when asking password
Date: 2005-06-30 08:41:36
Message-ID: 200506301041.36741.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Am Donnerstag, 30. Juni 2005 09:34 schrieb Adrian Maier:
> The attached patch modifies the message displayed by psql
> when asking the password "Password: "
> to include the username as well: "Password for user postgres : ".

I can't decode your attachment so I don't know if this is a typo or actually
in the patch, but there shouldn't be a space after the user name.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/


From: Adrian Maier <adrian(dot)maier(at)gmail(dot)com>
To: pgsql-patches(at)postgresql(dot)org
Subject: Re: psql patch for displaying the username when asking password
Date: 2005-06-30 10:26:21
Message-ID: cd30ef8c05063003264f0aac26@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

On 6/30/05, Peter Eisentraut <peter_e(at)gmx(dot)net> wrote:
> Am Donnerstag, 30. Juni 2005 09:34 schrieb Adrian Maier:
> > The attached patch modifies the message displayed by psql
> > when asking the password "Password: "
> > to include the username as well: "Password for user postgres : ".
>
> I can't decode your attachment so I don't know if this is a typo or
> actually in the patch, but there shouldn't be a space after the user name.

There was a space there. I've removed the space between
username and colons. The space after the colons is ok, I hope ?

I'm attaching the modified patch.

Cheers,
Adrian Maier

Attachment Content-Type Size
psql_password_prompt_v2.diff.gz application/x-gzip 907 bytes

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Adrian Maier <adrian(dot)maier(at)gmail(dot)com>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: psql patch for displaying the username when asking password
Date: 2005-07-25 17:17:44
Message-ID: 200507251717.j6PHHit14282@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches


Patch adjusted slightly, attached, and applied. Thanks.

---------------------------------------------------------------------------

Adrian Maier wrote:
> On 6/30/05, Peter Eisentraut <peter_e(at)gmx(dot)net> wrote:
> > Am Donnerstag, 30. Juni 2005 09:34 schrieb Adrian Maier:
> > > The attached patch modifies the message displayed by psql
> > > when asking the password "Password: "
> > > to include the username as well: "Password for user postgres : ".
> >
> > I can't decode your attachment so I don't know if this is a typo or
> > actually in the patch, but there shouldn't be a space after the user name.
>
> There was a space there. I've removed the space between
> username and colons. The space after the colons is ok, I hope ?
>
> I'm attaching the modified patch.
>
> Cheers,
> Adrian Maier

[ Attachment, skipping... ]

>
> ---------------------------(end of broadcast)---------------------------
> TIP 7: don't forget to increase your free space map settings

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

Attachment Content-Type Size
unknown_filename text/plain 3.8 KB

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Adrian Maier <adrian(dot)maier(at)gmail(dot)com>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: psql patch for displaying the username when asking password
Date: 2005-07-27 19:56:59
Message-ID: 200507271956.j6RJuxr07086@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Adrian Maier wrote:
> On 6/30/05, Peter Eisentraut <peter_e(at)gmx(dot)net> wrote:
> > Am Donnerstag, 30. Juni 2005 09:34 schrieb Adrian Maier:
> > > The attached patch modifies the message displayed by psql
> > > when asking the password "Password: "
> > > to include the username as well: "Password for user postgres : ".
> >
> > I can't decode your attachment so I don't know if this is a typo or
> > actually in the patch, but there shouldn't be a space after the user name.
>
> There was a space there. I've removed the space between
> username and colons. The space after the colons is ok, I hope ?
>
> I'm attaching the modified patch.

I made this adjustment in the applied version. Thanks.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073