Re: Temporarily suspend a user account?

From: Jerry Sievers <gsievers19(at)comcast(dot)net>
To: David G Johnston <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Temporarily suspend a user account?
Date: 2015-02-06 23:04:17
Message-ID: 86vbjeej66.fsf@jerry.enova.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

David G Johnston <david(dot)g(dot)johnston(at)gmail(dot)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(dot)consulting(at)comcast(dot)net
p: 312.241.7800

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2015-02-06 23:44:47 Re: Cluster seems broken after pg_basebackup
Previous Message David G Johnston 2015-02-06 23:01:11 Re: Temporarily suspend a user account?