Re: BUG #6704: ALTER EXTENSION postgis SET SCHEMA leaves dangling relations - Mailing list pgsql-bugs

From Dimitri Fontaine
Subject Re: BUG #6704: ALTER EXTENSION postgis SET SCHEMA leaves dangling relations
Date
Msg-id m2zk4e6p7m.fsf@2ndQuadrant.fr
Whole thread Raw
In response to Re: BUG #6704: ALTER EXTENSION postgis SET SCHEMA leaves dangling relations  (Dimitri Fontaine <dimitri@2ndQuadrant.fr>)
Responses Re: BUG #6704: ALTER EXTENSION postgis SET SCHEMA leaves dangling relations
List pgsql-bugs
Dimitri Fontaine <dimitri@2ndQuadrant.fr> writes:
> Side note: as soon as we have CREATE EXTENSION AS $$ script $$; we will
> be able to add those cases as regression tests. That's not the main
> usage of that feature, by far, but I can't resits the occasion :)

Oh, I did already mention it :)

> I have some local failures in `make check` that I'm not sure originate
> from that patch. Still wanted to have an opinion about the idea before
> cleaning up.

Sorry for sending unfinished preliminary version, I just had the
opportunity to look at what happened: views will create a composite type
that needs its pg_class row updated when doing ALTER VIEW SET SCHEMA.

That means that we need proper tracking for that operation even when it
happens outside of an extension update script, as in the attached
version 4 of the patch.

I think the way forward is to use the simplest one for back branches and
this one for master only, unless it is appreciated of light enough
impact, right? (provided it's ok, too)

  git diff --stat
   src/backend/commands/alter.c     |   14 +----
   src/backend/commands/extension.c |   48 +++++++++------
   src/backend/commands/tablecmds.c |  122 +++++++++++++++++++++++++++-----------
   src/backend/commands/typecmds.c  |   33 +++++++++-
   src/include/commands/alter.h     |    4 +-
   src/include/commands/tablecmds.h |    7 ++-
   src/include/commands/typecmds.h  |    6 +-
   7 files changed, 161 insertions(+), 73 deletions(-)

Regards,
--
Dimitri Fontaine
http://2ndQuadrant.fr     PostgreSQL : Expertise, Formation et Support


Attachment

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #7567: Sequences not properly replicated
Next
From: "Freddie Burgess"
Date:
Subject: Postgres Partitions not working with hibernate 4.1.6.Final