pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: jeff <jeff@pgexperts.com>
Cc: Pg Bugs <pgsql-bugs@postgresql.org>
Subject: Re: BUG #6704: ALTER EXTENSION postgis SET SCHEMA leaves dangling relations
Date: Fri, 31 Aug 2012 11:28:35 -0400
Message-ID: <1346425015-sup-3266@alvh.no-ip.org> (raw)
In-Reply-To: <26225.1340419030@sss.pgh.pa.us>
References: <E1SiEL6-0002u2-Ov@wrigleys.postgresql.org>
	<26225.1340419030@sss.pgh.pa.us>

Excerpts from Tom Lane's message of vie jun 22 22:37:10 -0400 2012:
> 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.

Aha, I see the bug.  It seems the split for AlterObjectNamespace_oid
related to tables was done at the wrong level: there should be a new
AlterTableNamespace_internal call that does all the extra stuff, and
which is to be called from AlterObjectNamespace_oid.

FWIW this bug seems to have been introduced in the initial extensions
commit, d9572c4e3b474031060189050e14ef384b94e001.  Prior to that we had
ExecAlterObjectSchemaStmt calling AlterTableNamespace directly.

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services




view thread (28+ messages)  latest in thread

Message-ID: <1346425015-sup-3266@alvh.no-ip.org>
Permalink:  ../1346425015-sup-3266@alvh.no-ip.org/
Also on:    postgresql.org/message-id/1346425015-sup-3266@alvh.no-ip.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: alvherre@2ndquadrant.com, tgl@sss.pgh.pa.us, jeff@pgexperts.com
  Subject: Re: BUG #6704: ALTER EXTENSION postgis SET SCHEMA leaves dangling relations
  In-Reply-To: <1346425015-sup-3266@alvh.no-ip.org>
  References: <E1SiEL6-0002u2-Ov@wrigleys.postgresql.org> <26225.1340419030@sss.pgh.pa.us> <1346425015-sup-3266@alvh.no-ip.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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