Обсуждение: BUG #4132: REASSIGN OWNED fails on procedural languages

Поиск
Список
Период
Сортировка

BUG #4132: REASSIGN OWNED fails on procedural languages

От
"Kirill Simonov"
Дата:
The following bug has been logged online:

Bug reference:      4132
Logged by:          Kirill Simonov
Email address:      xi@gamma.dn.ua
PostgreSQL version: 8.3.1
Operating system:   FreeBSD
Description:        REASSIGN OWNED fails on procedural languages
Details:

In Postgresql 8.3, one can assign owners to procedural languages using
"ALTER LANGUAGE ... OWNER TO ...".  However the command "REASSIGN OWNED ...
TO ...", which reassigns the owner of all objects owned by a particular
user, fails if the user owns a procedural language.  The error message is
"unexpected classid 2612", which is the class id of pg_language.

Here is a snippet of code for reproducing this problem:

CREATE USER original_owner SUPERUSER;
CREATE USER new_owner SUPERUSER;

CREATE LANGUAGE plpgsql;
ALTER LANGUAGE plpgsql OWNER TO original_owner;

REASSIGN OWNED BY original_owner TO new_owner;

Re: BUG #4132: REASSIGN OWNED fails on procedural languages

От
Alvaro Herrera
Дата:
Kirill Simonov wrote:

> In Postgresql 8.3, one can assign owners to procedural languages using
> "ALTER LANGUAGE ... OWNER TO ...".  However the command "REASSIGN OWNED ...
> TO ...", which reassigns the owner of all objects owned by a particular
> user, fails if the user owns a procedural language.  The error message is
> "unexpected classid 2612", which is the class id of pg_language.

Thanks for the report.  Apparently no one noticed when the new ALTER
LANGUAGE capability was added.

The attached patch should fix the problem.  I'm going to commit to 8.3
and HEAD in a jiffy.

--
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

Re: BUG #4132: REASSIGN OWNED fails on procedural languages

От
Alvaro Herrera
Дата:
Alvaro Herrera wrote:

> The attached patch should fix the problem.  I'm going to commit to 8.3
> and HEAD in a jiffy.

Really attached this time.  (Thanks Stefan.)

--
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

Вложения