Re: [HACKERS] psql Week 1

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Roland Roberts <roberts(at)panix(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [HACKERS] psql Week 1
Date: 1999-10-06 19:53:02
Message-ID: Pine.LNX.4.10.9910062151220.1744-100000@peter-e.yi.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Oct 5, Roland Roberts mentioned:

> Peter> * \connect now asks for password when appropriate
>
> Does this include the initial connect? I has password authentication
> enabled and think it would be nice if psql just prompted me rather
> than failed....

There was a design flaw in psql in that the -u switch always asked for
username *and* password. Those are essentially two separate things: Do you
want a different username than the default? and Do you need to enter a
password because you use that as authentication?

I resolved that by adding a switch -U to specifiy username and -P to
request a password prompt. If and only if you start psql with -P you will
get a password prompt any time you reconnect. (This is still not ideal
since the new database might not require a password, but there is no way
to read the pg_hba.conf from the front end obviously.) For backward
compatibility the -u switch essentially simulates "-U ? -P". (Username "?"
means prompt for username. You guys don't use question marks as username,
do you?)

I hope that solves it.

--
Peter Eisentraut - peter_e(at)gmx(dot)net
http://yi.org/peter-e/

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message sszabo 1999-10-06 20:17:39 Re: [HACKERS] Database names with spaces
Previous Message Peter Eisentraut 1999-10-06 19:46:17 Re: psql and comments