Re: Using psql, pg_dump, pg_restore in a script - Mailing list pgsql-admin

From Tom Lane
Subject Re: Using psql, pg_dump, pg_restore in a script
Date
Msg-id 25613.1402961610@sss.pgh.pa.us
Whole thread Raw
In response to Re: Using psql, pg_dump, pg_restore in a script  (hubert depesz lubaczewski <depesz@gmail.com>)
List pgsql-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


pgsql-admin by date:

Previous
From: hubert depesz lubaczewski
Date:
Subject: Re: Using psql, pg_dump, pg_restore in a script
Next
From: Евгений Селявка
Date:
Subject: Re: PostgreSQL db