Re: Can db user change own password?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Can db user change own password?
Дата
Msg-id 2441078.1634838709@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Can db user change own password?  (Toomas <toomas.kristin@gmail.com>)
Ответы Re: Can db user change own password?  (Adrian Klaver <adrian.klaver@aklaver.com>)
Список pgsql-general
Toomas <toomas.kristin@gmail.com> writes:
> 2) db=> select current_user, session_user;
>  current_user | session_user
> --------------+--------------
>  db_owner      | db_user
> (1 row)

Given that setup, I wonder which role you expected \password to change.

If we target the current_user, we can expect the command to succeed.
I'm just wondering if people will find that surprising.
Targeting the session_user might be less surprising (or not?)
but as this example shows, it can fail.

One thing that would help, regardless of which definition we think
is most appropriate, is to have \password explicitly say which role
it's intending to set the password for:

db=> \password
Enter new password for role "dbowner":
Enter it again:

            regards, tom lane



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Can db user change own password?
Следующее
От: Saurav Sarkar
Дата:
Сообщение: Re: Connection queuing by connection pooling libraries