Re: Starting psql from Script - how to pass the password?

From: Hubert Lubaczewski <hubert(dot)lubaczewski(at)eo(dot)pl>
To: Dani Oderbolz <oderbolz(at)ecologic(dot)de>, pgsql-novice(at)postgresql(dot)org
Subject: Re: Starting psql from Script - how to pass the password?
Date: 2003-06-20 12:22:04
Message-ID: 20030620142204.18abb1f5.hubert.lubaczewski@eo.pl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Fri, 20 Jun 2003 13:22:50 +0200
Dani Oderbolz <oderbolz(at)ecologic(dot)de> wrote:

> But still, psql prompts me for the password...
> Is there a way around this?

sure,
just:
export PGPASSWORD="your_password"
before calling postgresql programs.
than it doesn't ask.
but since it's raher dangerous, check if you can (version dependant), and use ~/.pgpass file instead.
you can find more information in postgresql-docs/html/libpq-envars.html

best regards

depesz

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Dani Oderbolz 2003-06-20 12:42:47 Re: Starting psql from Script - how to pass the password?
Previous Message Dani Oderbolz 2003-06-20 11:22:50 Starting psql from Script - how to pass the password?