Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TCBMB-000864-KQ for pgsql-bugs@postgresql.org; Thu, 13 Sep 2012 15:29:31 +0000 Received: from acidenitrix.villemain.org ([91.121.90.165]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TCBM9-0007ej-8H for pgsql-bugs@postgresql.org; Thu, 13 Sep 2012 15:29:30 +0000 Received: from cac94-7-82-243-26-157.fbx.proxad.net ([82.243.26.157] helo=DimIMac.local) by acidenitrix.villemain.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1TCBM4-0005kI-Fb; Thu, 13 Sep 2012 17:29:24 +0200 From: Dimitri Fontaine To: Alvaro Herrera Cc: Bruce Momjian , Tom Lane , jeff , Pg Bugs Subject: Re: BUG #6704: ALTER EXTENSION postgis SET SCHEMA leaves dangling relations Organization: 2ndQuadrant References: <26225.1340419030@sss.pgh.pa.us> <20120830214826.GC32350@momjian.us> <1347454709-sup-1105@alvh.no-ip.org> User-Mail-Address: dimitri@2ndQuadrant.fr Date: Thu, 13 Sep 2012 17:28:29 +0200 In-Reply-To: <1347454709-sup-1105@alvh.no-ip.org> (Alvaro Herrera's message of "Wed, 12 Sep 2012 10:05:39 -0300") Message-ID: User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.2 (darwin) MIME-Version: 1.0 Content-Type: text/plain X-Pg-Spam-Score: -0.3 (/) X-Archive-Number: 201209/116 X-Sequence-Number: 34111 Alvaro Herrera writes: > Well, what I saw was that both the table and its SERIAL-generated > sequence got an DEPENDENCY_EXTENSION row in pg_depend, which is exactly > what (IMV) causes the problem. One of my proposals is to tweak the code > to avoid that row (but if we do that, then we need to do something about > databases that contain such rows today). Ah yes, indeed. I think we shouldn't change the content of pg_depend lightly here, and that we should rather specialize AlterObjectNamespace_oid() to skip caring about sequences. The other objects that get moved by AlterTableNamepace other than the table itself and its sequences are Indexes and Constraints. Owned Sequence (serial) will get cared of by the extension dependency walking code. I'm going to have a try at that. Regards, -- Dimitri Fontaine http://2ndQuadrant.fr PostgreSQL : Expertise, Formation et Support