Re: Specifying psql password on command line

Поиск
Список
Период
Сортировка
От Anand Raman
Тема Re: Specifying psql password on command line
Дата
Msg-id 20010606101911.A2763@india-today.com
обсуждение исходный текст
Ответ на Specifying psql password on command line  ("Tauren Mills" <tauren@servlets.net>)
Список pgsql-general
preety simple.. In ur shell script use

psql -h localhost ur_db -U ur_user_name <<EOF
ur_passwd
ur_sql_script.sql
EOF

is this is too much of a botheration u can set the environment variables
PGUSER and PGPASSWD

Hope this helps
Anand


On Tue, Jun 05, 2001 at 05:59:28PM -0700, Tauren Mills wrote:
>I've read the documentation for the psql commands as well as the createdb
>and dropdb commands.  It looks like there is no way to specify the password
>on the command line.  The password is always provided in the form of a stdin
>prompt.
>
>This makes it very difficult to use the commands from a shell script or a
>cron job.    The same with redirecting to/from a file or piping it
>somewhere.  It seems like there must be some way to specify the password on
>the command line.
>
>Am I missing something?  Any workarounds?
>
>Thanks,
>Tauren
>
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

В списке pgsql-general по дате отправления:

Предыдущее
От: Doug McNaught
Дата:
Сообщение: Re: Sequences in transaction context
Следующее
От: Igor
Дата:
Сообщение: Re[2]: How to Alter tables with ARRAY? Help PLease