pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Oskari Saarenmaa <os@ohmu.fi>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: Show dropped users' backends in pg_stat_activity
Date: Wed, 16 Mar 2016 11:48:10 -0400
Message-ID: <16068.1458143290@sss.pgh.pa.us> (raw)
In-Reply-To: <CA+TgmoabAtxUpdG7XX3fXoVZef=Miy6Q2=_Ng-nGCfvzBgdbkw@mail.gmail.com>
References: <56E87CD8.60007@ohmu.fi>
	<CA+TgmoabAtxUpdG7XX3fXoVZef=Miy6Q2=_Ng-nGCfvzBgdbkw@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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


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



view thread (14+ messages)  latest in thread

Message-ID: <16068.1458143290@sss.pgh.pa.us>
Permalink:  ../16068.1458143290@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/16068.1458143290@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, robertmhaas@gmail.com, os@ohmu.fi
  Subject: Re: Show dropped users' backends in pg_stat_activity
  In-Reply-To: <16068.1458143290@sss.pgh.pa.us>
  References: <56E87CD8.60007@ohmu.fi> <CA+TgmoabAtxUpdG7XX3fXoVZef=Miy6Q2=_Ng-nGCfvzBgdbkw@mail.gmail.com> <16068.1458143290@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox