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

From Phillip Smith
Subject Re: Pass password in scripts?
Date
Msg-id 00b501c750a5$12d4f280$9b0014ac@wbaus090
Whole thread Raw
In response to Re: Pass password in scripts?  ("Neil Aggarwal" <neil@JAMMConsulting.com>)
Responses Re: Pass password in scripts?  ("Neil Aggarwal" <neil@JAMMConsulting.com>)
List pgsql-novice
Correct - whoever is running the script (and therefore psql), psql will look
in their home directory.

-p

-----Original Message-----
From: pgsql-novice-owner@postgresql.org
[mailto:pgsql-novice-owner@postgresql.org] On Behalf Of Neil Aggarwal
Sent: Thursday, 15 February 2007 12:55
To: 'Tom Lane'
Cc: pgsql-novice@postgresql.org
Subject: Re: [NOVICE] Pass password in scripts?

Tom:

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

Should I put it in the home directory for root?

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: Tom Lane [mailto:tgl@sss.pgh.pa.us]
Sent: Wednesday, February 14, 2007 7:35 PM
To: Neil Aggarwal
Cc: pgsql-novice@postgresql.org
Subject: Re: [NOVICE] Pass password in scripts?

"Neil Aggarwal" <neil@JAMMConsulting.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


---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster


*******************Confidentiality and Privilege Notice*******************

The material contained in this message is privileged and confidential to
the addressee.  If you are not the addressee indicated in this message or
responsible for delivery of the message to such person, you may not copy
or deliver this message to anyone, and you should destroy it and kindly
notify the sender by reply email.

Information in this message that does not relate to the official business
of Weatherbeeta must be treated as neither given nor endorsed by Weatherbeeta.
Weatherbeeta, its employees, contractors or associates shall not be liable
for direct, indirect or consequential loss arising from transmission of this
message or any attachments

pgsql-novice by date:

Previous
From: "Neil Aggarwal"
Date:
Subject: Re: Pass password in scripts?
Next
From: "Andrej Ricnik-Bay"
Date:
Subject: Re: Pass password in scripts?