Skip site navigation (1) Skip section navigation (2)

Re: Pass password in scripts?

From: "Neil Aggarwal" <neil(at)JAMMConsulting(dot)com>
To: "'Jan Danielsson'" <jan(dot)m(dot)danielsson(at)gmail(dot)com>
Cc: <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Pass password in scripts?
Date: 2007-02-15 01:59:20
Message-ID: 000b01c750a4$e8897690$0501a8c0@neilhp (view raw, whole thread or download thread mbox)
Lists: pgsql-novice

When I try that, I get:

/usr/local/pgsql/bin/psql: option `--password' doesn't allow an argument


Neil Aggarwal, (214)986-3533,
FREE! Eliminate junk email and reclaim your inbox.
Visit for details.

-----Original Message-----
From: pgsql-novice-owner(at)postgresql(dot)org
[mailto:pgsql-novice-owner(at)postgresql(dot)org] On Behalf Of Jan Danielsson
Sent: Wednesday, February 14, 2007 7:32 PM
To: Neil Aggarwal
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: [NOVICE] Pass password in scripts?

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:

Kind regards,
Jan Danielsson

In response to


pgsql-novice by date

Next:From: Phillip SmithDate: 2007-02-15 02:00:31
Subject: Re: Pass password in scripts?
Previous:From: Neil AggarwalDate: 2007-02-15 01:55:24
Subject: Re: Pass password in scripts?

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group