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

From Tom Lane
Subject Re: Show dropped users' backends in pg_stat_activity
Date
Msg-id 16068.1458143290@sss.pgh.pa.us
Whole thread Raw
In response to Re: Show dropped users' backends in pg_stat_activity  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: Show dropped users' backends in pg_stat_activity
Re: Show dropped users' backends in pg_stat_activity
List pgsql-hackers
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.

Even if we maintained some interlock for a backend's login role identity,
I hardly think it would be practical to e.g. lock during transient SET
ROLE or security-definer-function-call operations.  So it's not like we
can let the permissions system assume that a role OID being inquired about
always matches a live entry in pg_authid.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Joe Conway
Date:
Subject: Re: plpgsql - DECLARE - cannot to use %TYPE or %ROWTYPE for composite types
Next
From: Pavel Stehule
Date:
Subject: Re: plpgsql - DECLARE - cannot to use %TYPE or %ROWTYPE for composite types