pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Can't move extension out of pg_catalog
2+ messages / 2 participants
[nested] [flat]

* Can't move extension out of pg_catalog
@ 2012-06-15 18:11  Daniele Varrazzo <daniele.varrazzo@gmail.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Daniele Varrazzo @ 2012-06-15 18:11 UTC (permalink / raw)
  To: pgsql-bugs

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.

It is still possible to drop it.

Tested with PostgreSQL 9.1.3.

-- Daniele



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Can't move extension out of pg_catalog
@ 2012-06-15 19:49  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Daniele Varrazzo <daniele.varrazzo@gmail.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2012-06-15 19:49 UTC (permalink / raw)
  To: Daniele Varrazzo <daniele.varrazzo@gmail.com>; +Cc: 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



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2012-06-15 19:49 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2012-06-15 18:11 Can't move extension out of pg_catalog Daniele Varrazzo <daniele.varrazzo@gmail.com>
2012-06-15 19:49 ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox