Re: BUG #7748: "drop owned by" fails with error message: "unrecognized object class: 1262"

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: Jaime Casanova <jaime(at)2ndquadrant(dot)com>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, spam_eater(at)gmx(dot)net, pgsql-bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #7748: "drop owned by" fails with error message: "unrecognized object class: 1262"
Date: 2012-12-11 19:04:08
Message-ID: CAMkU=1y9vUF+tgggTkqX5dyK9ismHhTcK_hkHRSYO-vB-sz=OA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Sun, Dec 9, 2012 at 8:28 PM, Jaime Casanova <jaime(at)2ndquadrant(dot)com> wrote:
> On Sun, Dec 9, 2012 at 11:13 PM, Alvaro Herrera
> <alvherre(at)2ndquadrant(dot)com> wrote:
>> Tom Lane wrote:
>>>
>>> spam_eater(at)gmx(dot)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?
>>
>> I broke it recently: fe3b5eb08
>>
>
> whatever is the right way to solve this... shouldn't we do something
> similar in shdepReassignOwned() in which we are still ignoring shared
> objects?

Based on the commit message, it seems like it should *only* be in
shdepReassignOwned.

However, when I put it there it fails, as the code that does the
ownership change cannot deal with tablespaces (or databases)

ERROR: unexpected classid 1213

I am unsure of the goal here. The docs clearly say that only objects
in the current database are affected, so why are we even trying to do
something with tablespaces (or databases), which do not live in any
database? And if we want to change the contract to allow it to climb
out of the current database, why limit it to shared objects rather
than crawling all databases?

Cheers,

Jeff

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Jaime Casanova 2012-12-11 20:51:11 Re: BUG #7748: "drop owned by" fails with error message: "unrecognized object class: 1262"
Previous Message Chris Jerdonek 2012-12-11 19:03:48 Re: BUG #7744: docs should link to postgresql_psycopg2