connecting in shell scripts ?? - Mailing list pgsql-general

From Anand Raman
Subject connecting in shell scripts ??
Date
Msg-id 000701c0767b$ef8e28a0$9b8cc3cb@anand
Whole thread Raw
Responses Re: connecting in shell scripts ??
List pgsql-general
hi guys
I wish to connect to the database thru a cron job and do some sql queries,,
However i am having problems in connecting to the database thru the shell
script.. I am unable to pass the password..
I have been trying to do the following

#! /bin/sh
psql -h localhost db1 -U foo -c "select current_timestamp" < passwdfile
where passwdfile has the passwd for the connection

This isnt working.. I am a little confused for the same thing worked for
pg_dump..

Looking forward for ur suggestions..
I am on 7.0.3

Thanx
Anand Raman


pgsql-general by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: 7.0.3 rpm testing & other problems
Next
From: "Anand Raman"
Date:
Subject: \connect