Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1agSW9-0007Tp-9O for pgsql-hackers@arkaria.postgresql.org; Thu, 17 Mar 2016 07:38:49 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1agSW8-0003DL-SK for pgsql-hackers@arkaria.postgresql.org; Thu, 17 Mar 2016 07:38:48 +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 1agSW7-0003Cc-Dv for pgsql-hackers@postgresql.org; Thu, 17 Mar 2016 07:38:47 +0000 Received: from ohmu.fi ([213.157.68.249]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1agSW4-0001GV-Ns for pgsql-hackers@postgresql.org; Thu, 17 Mar 2016 07:38:47 +0000 Received: from [127.0.0.1] (localhost [IPv6:::1]) by ohmu.fi (Postfix) with ESMTP id C3C9660071; Thu, 17 Mar 2016 09:38:42 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ohmu.fi; s=ohmu20151014; t=1458200322; bh=yMTFwdTw029MWt68Bj55aZNoUmToWxNwDUhTZLMRfn4=; h=Subject:To:References:Cc:From:Date:In-Reply-To:From; b=QDiyvA6IfQirseauhRVJDvjE7y4XyY+zdat4IUFA0bmouTeNa23RCVjVlUhNDJXk+ HpFF6slA/Lo2I7IopNV5SHB+r5pr9pmKbXCw+OxIrJEgHbTtYrEOg5gYPeosc6UPzR zUyXFwnTooQwG322GM0xWkzCRzXY78yeRw/ntILo= Subject: Re: Show dropped users' backends in pg_stat_activity To: Tom Lane , Robert Haas References: <56E87CD8.60007@ohmu.fi> <16068.1458143290@sss.pgh.pa.us> Cc: "pgsql-hackers@postgresql.org" From: Oskari Saarenmaa Message-ID: <56EA5F01.7040407@ohmu.fi> Date: Thu, 17 Mar 2016 09:38:41 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <16068.1458143290@sss.pgh.pa.us> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.0 (--) 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 16.03.2016, 17:48, Tom Lane kirjoitti: > 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. 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 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers