Re: Can't move extension out of pg_catalog - Mailing list pgsql-bugs

From Tom Lane
Subject Re: Can't move extension out of pg_catalog
Date
Msg-id 2507.1339789795@sss.pgh.pa.us
Whole thread Raw
In response to Can't move extension out of pg_catalog  (Daniele Varrazzo <daniele.varrazzo@gmail.com>)
List pgsql-bugs
Daniele Varrazzo <daniele.varrazzo@gmail.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

pgsql-bugs by date:

Previous
From: Daniele Varrazzo
Date:
Subject: Can't move extension out of pg_catalog
Next
From: Euler Taveira
Date:
Subject: Re: BUG #6695: PgAdminIII