pgsql: Have REASSIGN OWNED work on extensions, too

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Have REASSIGN OWNED work on extensions, too
Date: 2012-07-03 19:21:22
Message-ID: E1Sm8f4-0006G9-Kq@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Have REASSIGN OWNED work on extensions, too

Per bug #6593, REASSIGN OWNED fails when the affected role has created
an extension. Even though the user related to the extension is not
nominally the owner, its OID appears on pg_shdepend and thus causes
problems when the user is to be dropped.

This commit adds code to change the "ownership" of the extension itself,
not of the contained objects. This is fine because it's currently only
called from REASSIGN OWNED, which would also modify the ownership of the
contained objects. However, this is not sufficient for a working ALTER
OWNER implementation extension.

Back-patch to 9.1, where extensions were introduced.

Bug #6593 reported by Emiliano Leporati.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/0c7b9dc7d037c4465227dc2300ff48019feeba37

Modified Files
--------------
src/backend/catalog/pg_shdepend.c | 5 ++
src/backend/commands/extension.c | 92 +++++++++++++++++++++++++++++++++++++
src/include/commands/extension.h | 2 +
3 files changed, 99 insertions(+), 0 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Alvaro Herrera 2012-07-03 20:41:41 pgsql: Forgot an #include in the previous patch :-(
Previous Message Bruce Momjian 2012-07-03 16:02:20 pgsql: Have copyright tool mention that certain files should be updated