pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ian Barwick <ian@barwick.de>
To: David F. Skoll <dfs@roaringpenguin.com>
To: pgsql-admin@postgresql.org
Subject: Re: Passwords and batch processes (was Re: Problem with Dump)
Date: Fri, 23 Aug 2002 18:34:48 +0200
Message-ID: <200208231834.48086.ian@barwick.de> (raw)
In-Reply-To: <Pine.LNX.4.44.0208231146100.2481-100000@shishi.roaringpenguin.com>
References: <Pine.LNX.4.44.0208231146100.2481-100000@shishi.roaringpenguin.com>

On Friday 23 August 2002 17:47, David F. Skoll wrote:
> On Fri, 23 Aug 2002, Ian Barwick wrote:
> > AFAIK utilities such as pg_dump prompt for the password but
> > won't accept it as a command line option, which makes password-based
> > authentication almost unusable when calling these utilities from a
> > script.
>
> This really should be Question #1 in the FAQ.
>
> You can set the environment variable PGPASSWORD to the password, and avoid
> prompts.  This assumes the same username/password has access to all the
> databases for pg_dumpall.
>
> I didn't find this documented anywhere.  It probably is, but somewhere
> buried...

here?:
http://www.postgresql.org/idocs/index.php?libpq-envars.html

The security-conscious might like to note:

"PGPASSWORD sets the password used if the backend demands password 
authentication. This is not recommended because the password can be read by 
others using the ps command with special options on some platforms."

(At least on FreeBSD ps can be made to show the calling user's, but no
other users' environment variables).

Should this be included in the FAQ (it doesn't seem to be) I would include
the recommendation that the permissions of any file where PGPASSWORD is set 
should be checked carefully.

Ian Barwick
barwick@gmx.net





view thread (6+ messages)  latest in thread

Message-ID: <200208231834.48086.ian@barwick.de>
Permalink:  ../200208231834.48086.ian@barwick.de/
Also on:    postgresql.org/message-id/200208231834.48086.ian@barwick.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: ian@barwick.de, dfs@roaringpenguin.com
  Subject: Re: Passwords and batch processes (was Re: Problem with Dump)
  In-Reply-To: <200208231834.48086.ian@barwick.de>
  References: <Pine.LNX.4.44.0208231146100.2481-100000@shishi.roaringpenguin.com> <200208231834.48086.ian@barwick.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox