Re: Show dropped users' backends in pg_stat_activity - Mailing list pgsql-hackers

From Oskari Saarenmaa
Subject Re: Show dropped users' backends in pg_stat_activity
Date
Msg-id 56EA5F01.7040407@ohmu.fi
Whole thread Raw
In response to Re: Show dropped users' backends in pg_stat_activity  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
16.03.2016, 17:48, Tom Lane kirjoitti:
> Robert Haas <robertmhaas@gmail.com> writes:
>> Gee, I would have expected the DROP to be blocked until the user
>> disconnected, like we do for DROP DATABASE.
>
> Making that race-condition-free would require some notion of a lock on
> roles, I think.  Seems pretty messy compared to the amount of actual
> value obtained.  There are good reasons why you can't have a backend
> running in a nonexistent database; but a backend with a nonexistent
> user OID is not really going to be a problem for anything except
> monitoring queries that fail to use left joins where appropriate.

I don't think most people expect dropped users to be able to keep using 
the database.  If it's not feasible to block DROP ROLE until the user 
has disconnected or to kill dropped users' sessions immediately after 
they're dropped we should at least show their sessions in 
pg_stat_activity and add a note about it in DROP ROLE docs.

/ Oskari



pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: Pushdown target list below gather node (WAS Re: WIP: Upper planner pathification)
Next
From: Amit Kapila
Date:
Subject: Re: [WIP] speeding up GIN build with parallel workers