Re: Providing the password to psql from a script

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Willem Herremans <willem(dot)herremans(at)belgacom(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Providing the password to psql from a script
Date: 2004-02-15 09:50:35
Message-ID: 20040215095035.GC25040@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sun, Feb 15, 2004 at 10:27:07AM +0100, Willem Herremans wrote:
> I am afraid this does not help me very much.
>
> The manpage of psql neither mentions the PGPASS environment variable,
> nor the .pgpass file.

Ok, so they're mentioned in the documentation, one under environment
variables. The other is mentioned in there too, aswell as briefly on the
manpage for pg_dumpall. A quick google should find the details for you.

> I understand that, if the server is configured such that the client can
> authenticate wihout password, that psql does not prompt for a password,
> but it would be a serious limitation for my application that it cannot
> support authenitication by means of password.

You could always redirect the password into stderr, though that's a bit of a
hack. Better just use one of the above supported methods.

--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> If the Catholic church can survive the printing press, science fiction
> will certainly weather the advent of bookwarez.
> http://craphound.com/ebooksneitherenorbooks.txt - Cory Doctorow

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Willem Herremans 2004-02-15 12:23:22 Re: Providing the password to psql from a script
Previous Message Stephan Szabo 2004-02-15 09:45:41 Re: Providing the password to psql from a script