Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Thpb6-0003N6-0k for pgsql-bugs@arkaria.postgresql.org; Sun, 09 Dec 2012 22:43:44 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1Thpb5-0001yu-0t for pgsql-bugs@arkaria.postgresql.org; Sun, 09 Dec 2012 22:43:43 +0000 Received: from magus.postgresql.org ([87.238.57.229]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Thpaw-0001rZ-9Q for pgsql-bugs@postgresql.org; Sun, 09 Dec 2012 22:43:34 +0000 Received: from plane.gmane.org ([80.91.229.3]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Thpau-0003eD-D3 for pgsql-bugs@postgresql.org; Sun, 09 Dec 2012 22:43:33 +0000 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Thpb3-0003y6-OI for pgsql-bugs@postgresql.org; Sun, 09 Dec 2012 23:43:41 +0100 Received: from ppp-93-104-191-205.dynamic.mnet-online.de ([93.104.191.205]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 09 Dec 2012 23:43:41 +0100 Received: from spam_eater by ppp-93-104-191-205.dynamic.mnet-online.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 09 Dec 2012 23:43:41 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-bugs@postgresql.org From: Thomas Kellerer Subject: Re: BUG #7748: "drop owned by" fails with error message: "unrecognized object class: 1262" Date: Sun, 09 Dec 2012 23:44:13 +0100 Lines: 44 Message-ID: References: <11629.1355071394@sss.pgh.pa.us> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: ppp-93-104-191-205.dynamic.mnet-online.de User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.21) Gecko/20090302 Thunderbird/2.0.0.21 Mnenhy/0.7.5.666 In-Reply-To: <11629.1355071394@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-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Tom Lane wrote on 09.12.2012 17:43: > spam_eater@gmx.net writes: >> postgres=# create user testuser with password 'secret'; >> CREATE ROLE >> postgres=# create database testdb owner testuser; >> CREATE DATABASE >> testdb=> drop owned by testuser; >> ERROR: unrecognized object class: 1262 > > I can reproduce this in all versions back to 8.3. In 8.2, the role's > ownership of the database is silently ignored, which I think was the > design intention. I doubt that we want DROP OWNED dropping whole > databases. At most maybe we should raise a NOTICE? > Just for clarification, this is how it worked in 9.1 (and I'm pretty sure in 9.2.1 as well): First I create a testuser and the database: C:\>psql -X -U postgres postgres psql (9.1.3) postgres=# create database testdb owner testuser; ERROR: role "testuser" does not exist postgres=# create user testuser with password 'secret'; CREATE ROLE postgres=# create database testdb owner testuser; CREATE DATABASE postgres=# \q Then I log in as the testuser, create a table and drop all objects again: C:\>psql -X -U testuser testdb Password for user testuser: psql (9.1.3) testdb=> create table foobar (id integer); CREATE TABLE testdb=> drop owned by testuser; DROP OWNED testdb=> -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs