Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bar9d-0000tD-Id for pgsql-hackers@arkaria.postgresql.org; Fri, 19 Aug 2016 21:16:41 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bar9c-0007ir-Mw for pgsql-hackers@arkaria.postgresql.org; Fri, 19 Aug 2016 21:16:40 +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 1bar9b-0007iC-Ld for pgsql-hackers@postgresql.org; Fri, 19 Aug 2016 21:16:39 +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 1bar9U-0005W0-JR for pgsql-hackers@postgresql.org; Fri, 19 Aug 2016 21:16:39 +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 u7JLGQDJ016319; Fri, 19 Aug 2016 17:16:26 -0400 From: Tom Lane To: Stephen Frost cc: Robert Haas , Kyotaro HORIGUCHI , Oskari Saarenmaa , "pgsql-hackers@postgresql.org" Subject: Re: Show dropped users' backends in pg_stat_activity In-reply-to: <20160325023347.GZ3127@tamriel.snowman.net> References: <56E87CD8.60007@ohmu.fi> <16068.1458143290@sss.pgh.pa.us> <20160323.123541.203539504.horiguchi.kyotaro@lab.ntt.co.jp> <3577.1458835419@sss.pgh.pa.us> <20160325023347.GZ3127@tamriel.snowman.net> Comments: In-reply-to Stephen Frost message dated "Thu, 24 Mar 2016 22:33:47 -0400" Date: Fri, 19 Aug 2016 17:16:26 -0400 Message-ID: <16318.1471641386@sss.pgh.pa.us> X-Pg-Spam-Score: -2.5 (--) 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 Stephen Frost writes: > * Tom Lane (tgl@sss.pgh.pa.us) wrote: >> I concur. Let's put the left join(s) into those views and call it >> good. > I'd suggest we also add some notes to the documentation that the correct > approach to dropping users is to disallow access first, then kill any > existing backends, and then drop the user. That, plus the left joins, > seems like it's good enough. I've pushed Oskari's original patch; a look around in system_views.sql shows that it's justified on the basis of consistency with other views even aside from the functional problem he ran into. The documentation question seems like material for a separate patch. 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