Re: pg_dump command inside shell scripts - Mailing list pgsql-admin

From David F. Skoll
Subject Re: pg_dump command inside shell scripts
Date
Msg-id Pine.LNX.4.44.0210080943200.2759-100000@shishi.roaringpenguin.com
Whole thread Raw
In response to pg_dump command inside shell scripts  (Elielson Fontanezi <ElielsonF@prodam.sp.gov.br>)
List pgsql-admin
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.


pgsql-admin by date:

Previous
From: Elielson Fontanezi
Date:
Subject: pg_dump command inside shell scripts
Next
From: Tom Lane
Date:
Subject: Re: problems with pltcl.so