Starting psql from Script - how to pass the password?

Поиск
Список
Период
Сортировка
От Dani Oderbolz
Тема Starting psql from Script - how to pass the password?
Дата
Msg-id 3EF2EE8A.70700@ecologic.de
обсуждение исходный текст
Ответы Re: Starting psql from Script - how to pass the password?  (Hubert Lubaczewski <hubert.lubaczewski@eo.pl>)
Список 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 по дате отправления:

Предыдущее
От: "paul butler"
Дата:
Сообщение: Re: Help regarding INSERT INTO statement
Следующее
От: Hubert Lubaczewski
Дата:
Сообщение: Re: Starting psql from Script - how to pass the password?