Unix Technical Forum

scripts and ~/.psqlrc

This is a discussion on scripts and ~/.psqlrc within the pgsql Admins forums, part of the PostgreSQL category; --> Hello I want to write some scripts which could connect to databse and work in background. I want to ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Admins

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-10-2008, 06:22 AM
teknet@poczta.onet.pl
 
Posts: n/a
Default 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@postgresql.org so that your
message can get through to the mailing list cleanly

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-10-2008, 06:22 AM
Peter Eisentraut
 
Posts: n/a
Default Re: scripts and ~/.psqlrc

teknet@poczta.onet.pl wrote:
> 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


The file you are looking for is ".pgpass".

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 08:46 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com