Batch authentication with psql -- SOLVED

Поиск
Список
Период
Сортировка
От David F. Skoll
Тема Batch authentication with psql -- SOLVED
Дата
Msg-id Pine.LNX.4.44.0207291117130.2557-100000@shishi.roaringpenguin.com
обсуждение исходный текст
Список pgsql-admin
Hi,

I needed a way to supply a password to psql from shell scripts and
cron jobs, but didn't want to install "expect" -- too complex.

I wrote a simple little C program called "notty" which convinces psql
that it has no controlliny TTY, and then it reads the password from
stdin.

So instead of:

    psql [options] < commands.sql

You use:

    (echo "password"; cat commands.sql) | notty psql [options]

The C source code is at http://www.roaringpenguin.com/notty.c.txt

It is verified to work on Linux and Solaris, and should work on any
modern UNIX.  On any decent UNIX system, you should be able to save
the file as "notty.c" and type:

    make notty

to build it.

Regards,

David.


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

Предыдущее
От: Jodi Kanter
Дата:
Сообщение: Re: bitwise AND
Следующее
От: "Jan Hartmann"
Дата:
Сообщение: Re: Multiple Postmasters on Beowulf cluster