David G Johnston <david.g.johns...@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.consult...@comcast.net
p: 312.241.7800


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to