Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 0B5F9CE6EC for ; Fri, 15 Jun 2012 16:50:10 -0300 (ADT) Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SfcX3-0008Si-9d for pgsql-bugs@postgresql.org; Fri, 15 Jun 2012 19:50:09 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.5/8.14.5) with ESMTP id q5FJntpk002508; Fri, 15 Jun 2012 15:49:55 -0400 (EDT) From: Tom Lane To: Daniele Varrazzo cc: pgsql-bugs@postgresql.org Subject: Re: Can't move extension out of pg_catalog In-reply-to: References: Comments: In-reply-to Daniele Varrazzo message dated "Fri, 15 Jun 2012 19:11:40 +0100" Date: Fri, 15 Jun 2012 15:49:55 -0400 Message-ID: <2507.1339789795@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201206/147 X-Sequence-Number: 33374 Daniele Varrazzo 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