Re: Temporarily suspend a user account? - Mailing list pgsql-general

From Jerry Sievers
Subject Re: Temporarily suspend a user account?
Date
Msg-id 86vbjeej66.fsf@jerry.enova.com
Whole thread Raw
In response to Re: Temporarily suspend a user account?  (David G Johnston <david.g.johnston@gmail.com>)
List 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 by date:

Previous
From: David G Johnston
Date:
Subject: Re: Temporarily suspend a user account?
Next
From: Adrian Klaver
Date:
Subject: Re: Cluster seems broken after pg_basebackup