Re: psql - prompt for password

Поиск
Список
Период
Сортировка
От Holger Jakobs
Тема Re: psql - prompt for password
Дата
Msg-id b233fdfe-a3ca-f5a2-cee4-2bf9ad5d6376@jakobs.com
обсуждение исходный текст
Ответ на psql - prompt for password  (Edwin UY <edwin.uy@gmail.com>)
Список pgsql-admin
Am 30.05.24 um 10:07 schrieb Edwin UY:
> Hi,
>
> Is createuser the only one I can use to create a user where it prompts 
> for a password? There is no alteruser though.
> I want to use psql and \prompt but am lost on how to use it.
> Basically just want to use it for running a psql script like for 
> example - ALTER USER spongebob WITH ENCRYPTED PASSWORD ':newpassword';
>
> Regards,
> Ed
>
>
You can feed a command into psql for that.

Example:

echo "alter user spongebob password 'secret2'" | psql

Add arguments for psql, like -U -d -h -p as needed.

Regards,

Holger

-- 

Holger Jakobs, Bergisch Gladbach, Tel. +49-178-9759012


Вложения

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

Предыдущее
От: Edwin UY
Дата:
Сообщение: psql - prompt for password
Следующее
От: Kashif Zeeshan
Дата:
Сообщение: Re: psql - prompt for password