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

From Bruce Momjian
Subject Re: psql: default base and password reading
Date
Msg-id 200110131939.f9DJddN07462@candle.pha.pa.us
Whole thread Raw
In response to Re: psql: default base and password reading  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: psql: default base and password reading  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-patches
> Tom Lane writes:
>
> > > 2. Password is reading from terminal (/dev/tty) rather than from
> > > stdin.
> >
> > Hmm, that might be a good idea.  Comments anyone?
>
> I guarantee you that within 24 hours after such a patch were checked in
> someone's going to complain that he has no /dev/tty.
>
> Meanwhile, there are a couple of possible workarounds:
>
> * PGPASSWORD environment variable.
>
> * FIFOs
>
> * (echo "Password"; pipe_input) | psql
>
> A generalized option to read the password from any file might make sense,
> though.

Have you seen my later version that reads from stdin/stderr if /dev/tty
doesn't open.  How is that?

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

pgsql-patches by date:

Previous
From: "Serguei Mokhov"
Date:
Subject: Re: PG_DUMP NLS (Russian)
Next
From: Bruce Momjian
Date:
Subject: Re: PG_DUMP NLS (Russian)