Re: Wrong order of tests in findDependentObjects()

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jim Nasby <Jim(dot)Nasby(at)BlueTreble(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Wrong order of tests in findDependentObjects()
Date: 2016-11-28 17:04:44
Message-ID: 5219.1480352684@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Jim Nasby <Jim(dot)Nasby(at)BlueTreble(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2016-11-28 17:18:21 Re: Autovacuum breakage from a734fd5d1
Previous Message Alvaro Herrera 2016-11-28 17:00:29 Re: pg_dump / copy bugs with "big lines" ?