Skip site navigation (1) Skip section navigation (2)

BUG #2310: "ALTER TYPE name OWNER TO new_owner" not working

From: "eKo1" <bernd(at)tti(dot)hn>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #2310: "ALTER TYPE name OWNER TO new_owner" not working
Date: 2006-03-09 20:24:20
Message-ID: 20060309202420.DD2E2F0B08@svr2.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-bugs
The following bug has been logged online:

Bug reference:      2310
Logged by:          eKo1
Email address:      bernd(at)tti(dot)hn
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.

Responses

pgsql-bugs by date

Next:From: MalixDate: 2006-03-10 00:26:34
Subject: Re: BUG #2303: UPDATE from manual is incorrect
Previous:From: Tom LaneDate: 2006-03-09 15:12:04
Subject: Re: BUG #2307: Buckup and sequences in DEFAULT part

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group