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