Re: Pass password in scripts? - Mailing list pgsql-novice

From Neil Aggarwal
Subject Re: Pass password in scripts?
Date
Msg-id 000b01c750a4$e8897690$0501a8c0@neilhp
Whole thread Raw
In response to Re: Pass password in scripts?  (Jan Danielsson <jan.m.danielsson@gmail.com>)
Responses Re: Pass password in scripts?
List pgsql-novice
Jan:

When I try that, I get:

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

Thanks,
    Neil


--
Neil Aggarwal, (214)986-3533, www.JAMMConsulting.com
FREE! Eliminate junk email and reclaim your inbox.
Visit http://www.spammilter.com for details.

-----Original Message-----
From: pgsql-novice-owner@postgresql.org
[mailto:pgsql-novice-owner@postgresql.org] On Behalf Of Jan Danielsson
Sent: Wednesday, February 14, 2007 7:32 PM
To: Neil Aggarwal
Cc: pgsql-novice@postgresql.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:
http://www.postgresql.org/docs/8.1/static/libpq-pgpass.html

--
Kind regards,
Jan Danielsson




pgsql-novice by date:

Previous
From: "Neil Aggarwal"
Date:
Subject: Re: Pass password in scripts?
Next
From: "Phillip Smith"
Date:
Subject: Re: Pass password in scripts?