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

Phil Sorber <phil@omniti.com> writes:
> On Wed, Mar 7, 2012 at 1:46 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> 1. If you forget to drop the temp table before ending the script,
>> then when the session ends and the temp table is forcibly dropped,
>> the whole extension goes away (following the rule that a forced drop
>> of an extension member makes the whole extension go away).  This is
>> mildly annoying, but since not dropping the temp table is a clear bug
>> in an extension script, I think we can live with it.

> This seems a little bit more than mildly annoying to me.

Well, I didn't say it wasn't annoying, but it would only be catastrophic
if applied to a production database; and it's certainly the sort of
thing you'd notice while testing the extension script.  Keep in mind
that those scripts run as superuser, so they can already do arbitrary
amounts of damage to your DB if inadequately tested.

If there were a reasonably non-ugly way to deal with the case I'd be
willing to put it in, but I don't see one.  I think the best we can do
is document it.

The other case, which only triggers if the script is run in a previously
virgin backend ID, scares me a lot more because it's the kind of corner
case that could easily escape reasonable testing of an extension script.

			regards, tom lane



view thread (12+ messages)  latest in thread

Message-ID: <20361.1331158105@sss.pgh.pa.us>
Permalink:  ../20361.1331158105@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/20361.1331158105@sss.pgh.pa.us

 · 

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

* 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