Re: BUG #2310: "ALTER TYPE name OWNER TO new_owner" not working - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #2310: "ALTER TYPE name OWNER TO new_owner" not working
Date
Msg-id 29303.1141953054@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #2310: "ALTER TYPE name OWNER TO new_owner" not working  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: BUG #2310: "ALTER TYPE name OWNER TO new_owner" not working  (berndlosert@netscape.net)
List pgsql-bugs
I wrote:
> The relevant owner field for a composite type is pg_type.typowner.
> We don't bother to maintain pg_class.relowner for the subsidiary
> pg_class entry.

Actually, now that I look at it, there is a non-cosmetic issue here:
we seem to be creating a dependency link for the pg_class owner field.
We have to either not do that, or be willing to fix it during ALTER TYPE
OWNER.  For instance

regression=# create user foo;
CREATE ROLE
regression=# create user bar;
CREATE ROLE
regression=# \c - foo
You are now connected as new user "foo".
regression=> create type mytype as (f1 int);
CREATE TYPE
regression=> \c - postgres
You are now connected as new user "postgres".
regression=# drop user foo;
ERROR:  role "foo" cannot be dropped because some objects depend on it
DETAIL:  owner of composite type mytype
owner of type mytype
regression=# alter type mytype owner to bar;
ALTER TYPE
regression=# drop user foo;
ERROR:  role "foo" cannot be dropped because some objects depend on it
DETAIL:  owner of composite type mytype
regression=#

            regards, tom lane

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #2310: "ALTER TYPE name OWNER TO new_owner" not working
Next
From: Malix
Date:
Subject: Re: BUG #2303: UPDATE from manual is incorrect