Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id BEA8A1E69C87 for ; Fri, 22 Jun 2012 23:37:30 -0300 (ADT) Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SiGE3-0001Jm-GE for pgsql-bugs@postgresql.org; Sat, 23 Jun 2012 02:37:29 +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 q5N2bA9e026226; Fri, 22 Jun 2012 22:37:10 -0400 (EDT) From: Tom Lane To: jeff@pgexperts.com cc: pgsql-bugs@postgresql.org Subject: Re: BUG #6704: ALTER EXTENSION postgis SET SCHEMA leaves dangling relations In-reply-to: References: Comments: In-reply-to jeff@pgexperts.com message dated "Sat, 23 Jun 2012 00:36:36 -0000" Date: Fri, 22 Jun 2012 22:37:10 -0400 Message-ID: <26225.1340419030@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201206/198 X-Sequence-Number: 33425 jeff@pgexperts.com writes: > DROP and CREATE extension appear to work fine, but if you ALTER EXTENSION > postgis SET SCHEMA foo, it leaves a few relations behind. What it seems to be leaving behind is indexes ... also relation rowtypes. A bit of looking shows that ALTER EXTENSION SET SCHEMA calls AlterObjectNamespace_oid on the table. AlterObjectNamespace_oid calls AlterRelationNamespaceInternal, and nothing else. In comparison, ALTER TABLE SET SCHEMA (AlterTableNamespace) calls AlterRelationNamespaceInternal and about four other things. I'm not sure if this was broken before the last round of refactoring in this area, but for sure it's broken now. regards, tom lane