pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: hubert depesz lubaczewski <depesz@gmail.com>
Cc: John Scalia <jayknowsunix@gmail.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: Using psql, pg_dump, pg_restore in a script
Date: Mon, 16 Jun 2014 19:33:30 -0400
Message-ID: <25613.1402961610@sss.pgh.pa.us> (raw)
In-Reply-To: <CAKrjmhcfhmcjEp+powf2BMYw9vdWH23O8FPcyokV6QDt2voi2Q@mail.gmail.com>
References: <539F3D20.1060001@gmail.com>
	<CAKrjmhcfhmcjEp+powf2BMYw9vdWH23O8FPcyokV6QDt2voi2Q@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-admin>

hubert depesz lubaczewski <depesz@gmail.com> writes:
> Giving password as command line option would show it to everybody.

Exactly.

> On the other hand - plaintext file should have privileges set so that
> noone, except for owner of the account from which you're running
> psql/pg_dump/pg_restore, can read it.

> If you prefer, you can set PGPASSWORD environment variable - it will also
> be used by all 3 of these programs (and most other).

Note that environment variables are also unsafe on some platforms, though
(I think) not all.  The .pgpass solution is actually quite the safest one.

			regards, tom lane


-- 
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin



view thread (3+ messages)

Message-ID: <25613.1402961610@sss.pgh.pa.us>
Permalink:  ../25613.1402961610@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/25613.1402961610@sss.pgh.pa.us

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, depesz@gmail.com, jayknowsunix@gmail.com
  Subject: Re: Using psql, pg_dump, pg_restore in a script
  In-Reply-To: <25613.1402961610@sss.pgh.pa.us>

* 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