Re: Wrong order of tests in findDependentObjects() - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Wrong order of tests in findDependentObjects()
Date
Msg-id 5219.1480352684@sss.pgh.pa.us
Whole thread Raw
In response to Re: Wrong order of tests in findDependentObjects()  (Jim Nasby <Jim.Nasby@BlueTreble.com>)
Responses Re: Wrong order of tests in findDependentObjects()  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Jim Nasby <Jim.Nasby@BlueTreble.com> writes:
> On 11/27/16 10:15 AM, Tom Lane wrote:
>> Yeah, I was wondering about that yesterday --- that comment mentions
>> the case of temporary objects, but it only fixes the problem while the
>> script runs.  Maybe there should be a separate test for "we're doing
>> temporary-object cleanup" that would similarly prevent recursion to
>> an extension?

> I can't think of any reason you'd want the current behavior.

> Though, it'd arguably be better to remove temp objects created by an 
> extension after the script exits, so that they can't "leak" into the 
> executing backend. Dunno if that's any harder or not...

Sounds way harder to me.  There's no good way to separate temp objects
made by the script from those made earlier in the session.  Also, the
general theory of extension scripts is that they're just executed
normally, with the only additional bit of magic being that objects
created during the script are tied to the extension.  I'm not sure that
forcibly dropping temp objects at the end fits in that charter at all.

But I think fixing it to not recurse to extensions during temp namespace
cleanup might not be very hard.  I'll take a look.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: pg_dump / copy bugs with "big lines" ?
Next
From: Tom Lane
Date:
Subject: Re: Autovacuum breakage from a734fd5d1