Starting psql from Script - how to pass the password? - Mailing list pgsql-novice

From Dani Oderbolz
Subject Starting psql from Script - how to pass the password?
Date
Msg-id 3EF2EE8A.70700@ecologic.de
Whole thread Raw
Responses Re: Starting psql from Script - how to pass the password?
List pgsql-novice
Hi all,
I am sure, this has been answerde over and over again,
but I did not find anything in the list-Archives.

I would like to run psql from a script, using a user that requires
a password (I know that I could change pg_hba.conf, but thats not what I
want).
Now, psql doesn't seem to take the password as an option,right?

I tried this:

/usr/local/pgsql/bin/psql -d "$DB" -U "$USER" -o "$OFILE"  -q -c "$SQL"
-F "$SEPARATOR" -t <<EOT "$PASS"
EOT

Where $PASS stores my password.
But still, psql prompts me for the password...

Is there a way around this?

Thanks,
Dani


pgsql-novice by date:

Previous
From: "paul butler"
Date:
Subject: Re: Help regarding INSERT INTO statement
Next
From: Hubert Lubaczewski
Date:
Subject: Re: Starting psql from Script - how to pass the password?