Re: psql: default base and password reading - Mailing list pgsql-patches

From Tom Lane
Subject Re: psql: default base and password reading
Date
Msg-id 10217.1002988037@sss.pgh.pa.us
Whole thread Raw
In response to Re: psql: default base and password reading  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-patches
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> The patch uses /dev/tty if it can open it, and stdin if it can't.  It
> does not have a psql flag to force stdin because there is little reason
> to read a password from stdin in any reasonable usage.

If we are reading the password from /dev/tty not stdin, then IMHO the
prompt for the password should be sent to /dev/tty not stderr.

> In fact, I wonder if we should just fail if we need to prompt for a
> password and can't open /dev/tty.  The function is simple_prompt() and
> if we can't open /dev/tty, maybe we should just assume the user typed
> nothing.

Would be okay with me ...

            regards, tom lane

pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: psql: default base and password reading
Next
From: Bruce Momjian
Date:
Subject: Re: psql: default base and password reading