connecting in shell scripts ??

From: "Anand Raman" <araman(at)india-today(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: connecting in shell scripts ??
Date: 2001-01-04 18:27:02
Message-ID: 000701c0767b$ef8e28a0$9b8cc3cb@anand
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Anand Raman 2001-01-04 18:38:23 \connect
Previous Message Peter Eisentraut 2001-01-04 18:02:22 Re: 7.0.3 rpm testing & other problems