Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1agDgL-0001ZW-49 for pgsql-hackers@arkaria.postgresql.org; Wed, 16 Mar 2016 15:48:21 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1agDgK-00010H-Lz for pgsql-hackers@arkaria.postgresql.org; Wed, 16 Mar 2016 15:48:20 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1agDgJ-0000zW-Fw for pgsql-hackers@postgresql.org; Wed, 16 Mar 2016 15:48:19 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1agDgG-0006QA-D4 for pgsql-hackers@postgresql.org; Wed, 16 Mar 2016 15:48:19 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id u2GFmAge016069; Wed, 16 Mar 2016 11:48:10 -0400 From: Tom Lane To: Robert Haas cc: Oskari Saarenmaa , "pgsql-hackers@postgresql.org" Subject: Re: Show dropped users' backends in pg_stat_activity In-reply-to: References: <56E87CD8.60007@ohmu.fi> Comments: In-reply-to Robert Haas message dated "Wed, 16 Mar 2016 11:36:06 -0400" Date: Wed, 16 Mar 2016 11:48:10 -0400 Message-ID: <16068.1458143290@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Robert Haas 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