Re: Can't move extension out of pg_catalog

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Daniele Varrazzo <daniele(dot)varrazzo(at)gmail(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: Can't move extension out of pg_catalog
Date: 2012-06-15 19:49:55
Message-ID: 2507.1339789795@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Daniele Varrazzo <daniele(dot)varrazzo(at)gmail(dot)com> writes:
> After moving an extension into the pg_catalog schema, it seems
> impossible to move it somewhere else:

> test=# create extension ltree;
> CREATE EXTENSION
> test=# alter extension ltree set schema pg_catalog;
> ALTER EXTENSION
> test=# alter extension ltree set schema public;
> ERROR: cannot remove dependency on schema pg_catalog because it is a
> system object.

Yeah, this is an implementation restriction that is unlikely to get
changed anytime soon. The problem is that moving the extension's
objects into pg_catalog results in dropping all their namespace
dependencies (since pg_catalog is a pinned object) and then there
is no way to resurrect that data if we want to move them someplace else.
See changeDependencyFor() in catalog/pg_depend.c.

Possibly it would be better to disallow this ALTER in both directions,
ie remove the support for the "drop the dependency" case in
changeDependencyFor().

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Euler Taveira 2012-06-15 20:22:55 Re: BUG #6695: PgAdminIII
Previous Message Daniele Varrazzo 2012-06-15 18:11:40 Can't move extension out of pg_catalog