Re: Wanted: ALTER TRIGGER ... OWNED BY EXTENSION - Mailing list pgsql-general

From Moshe Jacobson
Subject Re: Wanted: ALTER TRIGGER ... OWNED BY EXTENSION
Date
Msg-id CAJ4CxLkcpbwE4Rtv_WXYS_C1M3K3WAiwJ6MMpt409QXMCXtekQ@mail.gmail.com
Whole thread Raw
In response to Re: Wanted: ALTER TRIGGER ... OWNED BY EXTENSION  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
On Mon, Mar 31, 2014 at 5:19 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
Basically what you need to end up with is

* trigger function has a membership dependency on the extension

Yes, the dependency is set up when the trigger function is dynamically created by using ALTER EXTENSION ... ADD FUNCTION 

* pg_trigger row has a normal dependency on the trigger function it uses

Aha, this is not present. I think it is due to some migration magic I did a while ago. 
Is there a way to clean up the dependencies, or at least list out the dependencies that seem suspicious?

* pg_trigger row has an auto dependency on the table it's for

This is present.

Note: depending on what it is you're trying to accomplish, it might be
saner for the pg_trigger rows to have auto dependencies on their trigger
functions.  Depends whether you'd like DROP EXTENSION to complain or just
shut up and drop the triggers.

I would love for DROP EXTENSION to shut up and drop the triggers, but I'm not sure how to accomplish that without manually manipulating pg_depend (and even then I'm not sure if that'll do it). Suggestions welcome.

Thanks.

Moshe Jacobson
Manager of Systems Engineering, Nead Werx Inc.
2323 Cumberland Parkway · Suite 201 · Atlanta, GA 30339

"Quality is not an act, it is a habit." -- Aristotle

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Wanted: ALTER TRIGGER ... OWNED BY EXTENSION
Next
From: Jeff Janes
Date:
Subject: Re: Postgres as In-Memory Database?