Re: scripts and ~/.psqlrc

From: "Tomeh, Husam" <htomeh(at)firstam(dot)com>
To: teknet(at)poczta(dot)onet(dot)pl, pgsql-admin(at)postgresql(dot)org
Subject: Re: scripts and ~/.psqlrc
Date: 2005-10-18 20:24:11
Message-ID: C45835824D00A844BBD0F032D5CDED9202D554BA@pisgana01sxch01.ana.firstamdata.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin


" PGPASSWORD sets the password used if the server demands password
authentication. Use of this environment variable is not recommended for
security reasons (some operating systems allow non-root users to see
process environment variables via ps); instead consider using the
~/.pgpass file "

--
Husam

-----Original Message-----
From: pgsql-admin-owner(at)postgresql(dot)org
[mailto:pgsql-admin-owner(at)postgresql(dot)org] On Behalf Of
teknet(at)poczta(dot)onet(dot)pl
Sent: Saturday, October 15, 2005 9:08 AM
To: pgsql-admin(at)postgresql(dot)org
Subject: [ADMIN] scripts and ~/.psqlrc

Hello

I want to write some scripts which could connect to databse and work in
background. I want to avoid situation in which i have to
manually/interactively give appriopriate password everytime i query
database.

How can i do it in most easily way ?

I found that there is ~/.psqlrc file which could be used as
configuration file for user. Can i put there databsename, hostname,
username and most important: password ?, so i could connect to my
database only by typing:
#psql

Thanx
Michal

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
message can get through to the mailing list cleanly

**********************************************************************
This message contains confidential information intended only for the
use of the addressee(s) named above and may contain information that
is legally privileged. If you are not the addressee, or the person
responsible for delivering it to the addressee, you are hereby
notified that reading, disseminating, distributing or copying this
message is strictly prohibited. If you have received this message by
mistake, please immediately notify us by replying to the message and
delete the original message immediately thereafter.

Thank you. FADLD Tag
**********************************************************************

Browse pgsql-admin by date

  From Date Subject
Next Message Kevin Grittner 2005-10-18 20:29:00 Re: PostgreSQL running in the background....
Previous Message Andrew Sullivan 2005-10-18 16:13:51 Re: Solving OID wrap-around in 7.4 DB?