Re: Pass password in scripts?

From: Jan Danielsson <jan(dot)m(dot)danielsson(at)gmail(dot)com>
To: Neil Aggarwal <neil(at)JAMMConsulting(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Pass password in scripts?
Date: 2007-02-15 01:31:31
Message-ID: 45D3B7F3.7060502@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Neil Aggarwal wrote:
> Hello:
>
> I have several scripts I would like to run against a database.
>
> With mysql, I can pass the password to the database in
> the command line call to the terminal client.
>
> Is there a way to do that with psql?

You mean like:

$ psql --user=foobar --password=boofar < script.sql

Another possibility, if you don't want the password to be visible to
other users on the system, is to use the ~/.pgpass file. See:
http://www.postgresql.org/docs/8.1/static/libpq-pgpass.html

--
Kind regards,
Jan Danielsson

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2007-02-15 01:35:01 Re: Pass password in scripts?
Previous Message Burak Seydioglu 2007-02-15 01:28:30 Re: Pass password in scripts?