The following bug has been logged online: Bug reference: 2310 Logged by: eKo1 Email address: [EMAIL PROTECTED] PostgreSQL version: 8.1.3 Operating system: Linux Fedora Core 3 Description: "ALTER TYPE name OWNER TO new_owner" not working Details:
I have the following function that displays the relation-like objects owned by a user in a given schema: ------------------------------------------------------- create or replace function fn_show_owned(text, text) returns setof text as $$ declare v_user alias for $1; v_schema alias for $2; v_rec record; begin for v_rec in select relname from pg_class, pg_namespace, pg_user where pg_namespace.oid = relnamespace and nspname = v_schema and relowner = usesysid and usename = v_user loop return next v_rec.relname; end loop; return; end; $$ language plpgsql; ------------------------------------------------------- Here is what I did to confirm that "ALTER TYPE name OWNER TO new_owner" is not working: testdb=# select * from fn_show_owned('bernd','public'); fn_show_owned --------------- (0 rows) testdb=# create type MyType as (a int); CREATE TYPE testdb=# select * from fn_show_owned('bernd','public'); fn_show_owned --------------- mytype (1 row) testdb=# alter type MyType owner to wiki; ALTER TYPE testdb=# select * from fn_show_owned('bernd','public'); fn_show_owned --------------- mytype (1 row) testdb=# \c - wiki You are now connected as new user "wiki". testdb=> select * from fn_show_owned('wiki','public'); fn_show_owned --------------- (0 rows) As you can see, changing the owner does nothing. If I do the above for a table, it works fine, so I'm pretty sure this is a bug. I also tested this in 8.1.2 on the same FC3 machine and in 8.1.1 on CentOS 3. I get the same results. ---------------------------(end of broadcast)--------------------------- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match