Re: PGPASSWORD - Mailing list pgsql-bugs

From Tom Lane
Subject Re: PGPASSWORD
Date
Msg-id 8230.1109365753@sss.pgh.pa.us
Whole thread Raw
In response to Re: PGPASSWORD  (Oliver Jowett <oliver@opencloud.com>)
Responses Re: PGPASSWORD  (Oliver Jowett <oliver@opencloud.com>)
List pgsql-bugs
Oliver Jowett <oliver@opencloud.com> writes:
> If you're a shell script calling psql / pg_dump / etc, how do you do this?

That doesn't strike me as a compelling case for inventing "--password-fd".
Such a shell script is going to have a hard time passing a password
securely anyway (you weren't planning to "echo $PW" it somewhere, I trust).
And why should the shell script have its fingers on the password in the
first place?  It has no "need to know", and more chances to leak the
password unintentionally than one likes to think about.

If you really don't want to solve the problem with .pgpass, I'd
recommend letting the invoked program collect the password for itself.
That's exactly why we do the collection on /dev/tty and not stdin.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Oliver Jowett
Date:
Subject: Re: PGPASSWORD
Next
From: postgresbugs
Date:
Subject: Re: PGPASSWORD