Re: Reset Postgresql users password
От | Chris Travers |
---|---|
Тема | Re: Reset Postgresql users password |
Дата | |
Msg-id | CAKt_Zft9gjbQB003MgMSHR3-JXei2ccvMB+BRuK6KUXUhPLR+Q@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Reset Postgresql users password (Ron <ronljohnsonjr@gmail.com>) |
Список | pgsql-general |
You can use a DO block or write a function do to this.
It takes some practice (and you need to use EXECUTE FORMAT())
If users need to be able to change their own users, something like this works:
CREATE FUNCTION change_my_password(in_password, text)
It takes some practice (and you need to use EXECUTE FORMAT())
If users need to be able to change their own users, something like this works:
CREATE FUNCTION change_my_password(in_password, text)
returns void language plpgsql as
$$
begin
EXECUTE FORMAT($F$ALTER USER $I WITH PASSWORD %L$F$, session_user, in_password);
end;
$$ SECURITY DEFINER;
On Mon, Jul 17, 2023 at 9:28 AM Ron <ronljohnsonjr@gmail.com> wrote:
On 7/12/23 14:28, Johnathan Tiamoh wrote:
> Hello,
>
> I wish to find out if there is a way to reset all users in Postgresql
> password to the same password at once.
To the same value??
--
Born in Arizona, moved to Babylonia.
Best Wishes,
Chris Travers
Efficito: Hosted Accounting and ERP. Robust and Flexible. No vendor lock-in.
В списке pgsql-general по дате отправления: