RE: Specifying psql password on command line

Поиск
Список
Период
Сортировка
От Tauren Mills
Тема RE: Specifying psql password on command line
Дата
Msg-id NBBBLBKDJMGDNPMDGAABEEBEAEAB.tauren@servlets.net
обсуждение исходный текст
Ответ на Re: Specifying psql password on command line  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
> > 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.
>
> Quite deliberately ... if passwords were provided on the command line,
> then anyone else on your machine could read them off with 'ps'.

I was actually wondering if that was the reason.  I know that with MySQL,
the mysql program immediately changes the command line that is displayed
with 'ps' so that you simply see 'xxxxxx' for the password.  However, there
is an instant that ps could report the password.

I would think that there would be some way to do this, however.  For
instance, specify a file path that contains the password.  It seems like
someone out there must be running the command line programs from an
automated script.  How are you doing it?  Using something like 'expect'?

I'd love to see an example script if anyone has one.

Thanks,
Tauren





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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Specifying psql password on command line
Следующее
От: "Tauren Mills"
Дата:
Сообщение: RE: [ADMIN] Alternate database locations