Re: pg_dump command inside shell scripts

From: "David F(dot) Skoll" <dfs(at)roaringpenguin(dot)com>
To: Elielson Fontanezi <ElielsonF(at)prodam(dot)sp(dot)gov(dot)br>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>, pgsql-admin <pgsql-admin(at)postgresql(dot)org>, Gerson Leite da Silva <gerson(dot)silva(at)prodam(dot)sp(dot)gov(dot)br>
Subject: Re: pg_dump command inside shell scripts
Date: 2002-10-08 13:45:41
Message-ID: Pine.LNX.4.44.0210080943200.2759-100000@shishi.roaringpenguin.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-general

On Tue, 8 Oct 2002, Elielson Fontanezi wrote:

> to identify Linux user which starts the shell script to avoid password
> prompt.

There's a virtually-undocmented environment variable: PGPASSWORD

PGPASSWORD="secret-password"
export PGPASSWORD
# Now pg_dump will not prompt for password.
pg_dump -U postgres ...

Make sure you only use this in a script which normal users cannot read,
and on a system which hides root-process environment variables from
being displayed by normal users (with ps).

--
David.

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2002-10-08 13:50:22 Re: problems with pltcl.so
Previous Message Elielson Fontanezi 2002-10-08 13:35:55 pg_dump command inside shell scripts

Browse pgsql-general by date

  From Date Subject
Next Message Robert Treat 2002-10-08 13:48:23 Re: How to find out about index
Previous Message Tom Lane 2002-10-08 13:42:24 Re: Server locale?