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

Re: Pass password in scripts?

From: "Neil Aggarwal" <neil(at)JAMMConsulting(dot)com>
To: "'Tom Lane'" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Pass password in scripts?
Date: 2007-02-15 01:55:24
Message-ID: 000701c750a4$5c702320$0501a8c0@neilhp (view raw, whole thread or download thread mbox)
Lists: pgsql-novice

There is no ~ directory for the db user.
The scripts run as root.  

Should I put it in the home directory for root?


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

-----Original Message-----
From: Tom Lane [mailto:tgl(at)sss(dot)pgh(dot)pa(dot)us] 
Sent: Wednesday, February 14, 2007 7:35 PM
To: Neil Aggarwal
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: [NOVICE] Pass password in scripts? 

"Neil Aggarwal" <neil(at)JAMMConsulting(dot)com> writes:
> With mysql, I can pass the password to the database in 
> the command line call to the terminal client.

Really?  That's an enormous security hole, because anyone running "ps"
on the system can see your password.

> Is there a way to do that with psql?

Consider using a ~/.pgpass file instead.  Much safer.

			regards, tom lane

In response to


pgsql-novice by date

Next:From: Neil AggarwalDate: 2007-02-15 01:59:20
Subject: Re: Pass password in scripts?
Previous:From: Tom LaneDate: 2007-02-15 01:35:01
Subject: Re: Pass password in scripts?

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