Re: Temporarily suspend a user account?

Поиск
Список
Период
Сортировка
От Jerry Sievers
Тема Re: Temporarily suspend a user account?
Дата
Msg-id 86vbjeej66.fsf@jerry.enova.com
обсуждение исходный текст
Ответ на Re: Temporarily suspend a user account?  (David G Johnston <david.g.johnston@gmail.com>)
Список pgsql-general
David G Johnston <david.g.johnston@gmail.com> writes:

> On Fri, Feb 6, 2015 at 3:41 PM, Felipe Gasper [via PostgreSQL] <[hidden email]> wrote:
>
>     So, this works when I do it manually, but not when I script it.
>
>     Is it possible that this change doesn’t take effect immediately? Is
>     there any way to tell when it does (besides just waiting until login
>     attempts fail)?
>
> ​It should take effect when you commit the transaction in which you perform the update...
>
> The active sessions would remain logged in but future attempts to login would fail.

Right.  Nothing about disabling an account causes existing sessions to
close.

The OP should do...

mangle password and commit;
pg_terminate_backend(disabled user);

WAiting a few seconds between those steps probably not a bad idea to
help avoid a race  if any  between pw authentication and a session
registering in pg_stat_activity.


> ​David J.
>
> ------------------------------------------
> View this message in context: Re: Temporarily suspend a user account?
> Sent from the PostgreSQL - general mailing list archive at Nabble.com.
>

--
Jerry Sievers
Postgres DBA/Development Consulting
e: postgres.consulting@comcast.net
p: 312.241.7800


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

Предыдущее
От: David G Johnston
Дата:
Сообщение: Re: Temporarily suspend a user account?
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: Cluster seems broken after pg_basebackup