Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id DEEFDB5DC20 for ; Wed, 20 Jul 2011 16:55:16 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 72379-10 for ; Wed, 20 Jul 2011 19:55:10 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from spinlock.commandprompt.com (host-215.commandprompt.net [207.173.203.215]) by mail.postgresql.org (Postfix) with ESMTP id 91862B5DC06 for ; Wed, 20 Jul 2011 16:55:08 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by spinlock.commandprompt.com (Postfix) with ESMTP id 13E1F34C394; Wed, 20 Jul 2011 12:55:08 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at commandprompt.com Received: from spinlock.commandprompt.com ([127.0.0.1]) by localhost (spinlock.commandprompt.com.commandprompt.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PSZe0FCVzRrZ; Wed, 20 Jul 2011 12:55:06 -0700 (PDT) Received: from perhan.alvh.no-ip.org (unknown [190.95.11.98]) by spinlock.commandprompt.com (Postfix) with ESMTPSA id CFFED348046; Wed, 20 Jul 2011 12:55:05 -0700 (PDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id E44FF6E3DE; Wed, 20 Jul 2011 15:55:02 -0400 (CLT) Content-Type: text/plain; charset=UTF-8 Cc: tushar , Pg Bugs Subject: Re: BUG #6116: Not able to drop user if S/he has permission on tablespace From: Alvaro Herrera To: Robert Haas In-reply-to: References: <201107131257.p6DCvIDA098948@wwwmaster.postgresql.org> Date: Wed, 20 Jul 2011 15:55:02 -0400 Message-Id: <1311191541-sup-1840@alvh.no-ip.org> User-Agent: Sup/git Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-5 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201107/152 X-Sequence-Number: 30764 Excerpts from Robert Haas's message of mié jul 20 15:11:47 -0400 2011: > The "DROP OWNED BY" command only drops objects that are owned by a > user. It doesn't revoke privileges that user has granted: those > aren't considered dropable objects. So technically speaking all of > those commands are working just as expected. > > Nevertheless, I agree with you that the behavior here leaves a lot to > be desired. Hunting down the privilege grant that is stopping you > from dropping a user is pretty darn annoying. I am not sure what to > do about that, though. The message detail indicates what's the grant that needs to be revoked. IIRC we discussed whether DROP OWNED should revoke privileges on tablespaces and databases just like it does for regular (non shared) objects, but that went nowhere and nothing got done about it. I think the expectation is that a combination of DROP OWNED and REASSIGN OWNED, when applied to sufficient databases, should be enough to let you drop a user. With that in mind, fixing this bug should be straightforward. -- Álvaro Herrera The PostgreSQL Company - Command Prompt, Inc. PostgreSQL Replication, Consulting, Custom Development, 24x7 support