pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jim Nasby <Jim.Nasby@BlueTreble.com>
Cc: pgsql-hackers@postgresql.org
Subject: Re: Wrong order of tests in findDependentObjects()
Date: Fri, 02 Dec 2016 15:05:00 -0500
Message-ID: <17348.1480709100@sss.pgh.pa.us> (raw)
In-Reply-To: <20649.1480634936@sss.pgh.pa.us>
References: <13224.1480177514@sss.pgh.pa.us>
	<e51f4311-f483-4dd0-1ccc-abec3c405110@BlueTreble.com>
	<5774.1480263301@sss.pgh.pa.us>
	<865865e1-7064-0319-e7ea-13b7fddad4f1@BlueTreble.com>
	<5219.1480352684@sss.pgh.pa.us>
	<23800.1480362490@sss.pgh.pa.us>
	<13624.1480626576@sss.pgh.pa.us>
	<91fc28a2-cff7-abb5-08dc-9715f938b55b@BlueTreble.com>
	<20649.1480634936@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

I wrote:
> Jim Nasby <Jim.Nasby@BlueTreble.com> writes:
>> On 12/1/16 1:09 PM, Tom Lane wrote:
>>> I think that the patch I wrote is good cleanup, so I'm still inclined
>>> to apply it in HEAD, but I no longer think it's fixing any case that's
>>> significant in the field.  I wonder if you have a counterexample?

>> No; I'm sure I've run into this because of a temp object other than a 
>> table (probably a function, though possibly something else).

> Makes sense.  The fact that we protect against this for temp tables and
> views would make it all the more surprising when you get bit by some
> less-common object type.

It occurred to me that the hack installed in 08dd23cec, to not record
a pg_depend entry for a temp table, causes its own set of misbehaviors.
If you drop the extension later in the same session, the temp table isn't
automatically removed.  This would cause repeated drop/create cycles to
fail, which is kind of annoying since you might well do that during
extension development.  Even more annoying, if the temp table has another
sort of dependency on the extension --- say, it uses a data type defined
by the extension --- the DROP EXTENSION would fail unless you say CASCADE.

So I've pushed this patch with an addition to revert that hack.  I added
a regression test case showing that such usage behaves properly now.

			regards, tom lane


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



view thread (10+ messages)

Message-ID: <17348.1480709100@sss.pgh.pa.us>
Permalink:  ../17348.1480709100@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/17348.1480709100@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-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, Jim.Nasby@BlueTreble.com
  Subject: Re: Wrong order of tests in findDependentObjects()
  In-Reply-To: <17348.1480709100@sss.pgh.pa.us>
  References: <13224.1480177514@sss.pgh.pa.us> <e51f4311-f483-4dd0-1ccc-abec3c405110@BlueTreble.com> <5774.1480263301@sss.pgh.pa.us> <865865e1-7064-0319-e7ea-13b7fddad4f1@BlueTreble.com> <5219.1480352684@sss.pgh.pa.us> <23800.1480362490@sss.pgh.pa.us> <13624.1480626576@sss.pgh.pa.us> <91fc28a2-cff7-abb5-08dc-9715f938b55b@BlueTreble.com> <20649.1480634936@sss.pgh.pa.us> <17348.1480709100@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