Re: Wrong order of tests in findDependentObjects()

From: Jim Nasby <Jim(dot)Nasby(at)BlueTreble(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: Wrong order of tests in findDependentObjects()
Date: 2016-11-27 23:35:52
Message-ID: 865865e1-7064-0319-e7ea-13b7fddad4f1@BlueTreble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 11/27/16 10:15 AM, Tom Lane wrote:
> Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)com> writes:
>> I suspect this is unrelated, but I've run into another oddity with
>> extension dependency: if an extension creates any temporary objects the
>> extension will install and function correctly... until the backend that
>> created the extension quits. This is VERY confusing if you've never come
>> across it before, because you'll do a bunch of work in a single script
>> but when you try to use the extension for real it will "randomly" just
>> vanish.
>
> 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...
--
Jim Nasby, Data Architect, Blue Treble Consulting, Austin TX
Experts in Analytics, Data Architecture and PostgreSQL
Data in Trouble? Get it in Treble! http://BlueTreble.com
855-TREBLE2 (855-873-2532)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Karl O. Pinc 2016-11-27 23:37:07 Re: Patch to implement pg_current_logfile() function
Previous Message Robert Haas 2016-11-27 23:20:03 Re: UNDO and in-place update