pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dimitri Fontaine <dimitri@2ndQuadrant.fr>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Phil Sorber <phil@omniti.com>
Cc: pgsql-bugs@postgresql.org
Cc: Dimitri Fontaine <dimitri@2ndQuadrant.fr>
Subject: Re: Extension tracking temp table and causing update failure
Date: Wed, 07 Mar 2012 10:14:21 +0100
Message-ID: <87linc93iq.fsf@hi-media-techno.com> (raw)
In-Reply-To: <21101.1331071837@sss.pgh.pa.us>
References: <CADAkt-i4kJn_ht=+6x408uVjQG4XKjvy3FbyMKer+oJATLWykQ@mail.gmail.com>
	<21101.1331071837@sss.pgh.pa.us>

Tom Lane <tgl@sss.pgh.pa.us> writes:
> However, recordDependencyOnCurrentExtension doesn't know that the table
> is meant to be transient and links it to the current extension; so when
> the table gets dropped a bit later, the dependency code complains.
>
> [...]
>
> Instead, I'm tempted to propose that dependency.c explicitly allow drops
> of objects that belong to the current extension, when an extension is
> being created or updated.  (That is, if we come across a dependency
> reference to the active extension, we just ignore it.  A quick look
> suggests that this would require only a very small patch.)  That would
> prevent the entire class of problems.

Thinking about it, what I think makes sense at the user level is that
you can either DROP an extension's object in the extension script or
detach it so that it still exists on its own.

That means we still need to be able to ALTER EXTENSION … DROP and that
this operation should be automatically handled when the extension's
script contains a DROP command.  The way to implement that seems to be
exactly what you're saying.

(So that view is mostly useful for how to document the behaviour).

> It would also have the effect that explicit DROPs of member objects in
> extension scripts could be done without an explicit ALTER EXTENSION DROP
> first.  I think we'd originally decided that requiring the ALTER was a
> good safety feature, but is it really more than nanny-ism?  The intent
> of a DROP command seems pretty clear.

What I remember we decided is that you can't DROP any single object of
an extension alone, you have to drop the extension wholesale or not at
all. So that you first “detach” the object from the extension then drop
it. That makes perfect sense in general but is a useless restriction
when executing an extension's script.

I consider that bugfix for back branches, by the way (well, 9.1).

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



view thread (12+ messages)  latest in thread

Message-ID: <87linc93iq.fsf@hi-media-techno.com>
Permalink:  ../87linc93iq.fsf@hi-media-techno.com/
Also on:    postgresql.org/message-id/87linc93iq.fsf@hi-media-techno.com

 · 

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: dimitri@2ndQuadrant.fr, tgl@sss.pgh.pa.us, phil@omniti.com
  Subject: Re: Extension tracking temp table and causing update failure
  In-Reply-To: <87linc93iq.fsf@hi-media-techno.com>
  References: <CADAkt-i4kJn_ht=+6x408uVjQG4XKjvy3FbyMKer+oJATLWykQ@mail.gmail.com> <21101.1331071837@sss.pgh.pa.us> <87linc93iq.fsf@hi-media-techno.com>

* 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