Re: Command Triggers, patch v11

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: <dimitri(at)2ndquadrant(dot)fr>,<thom(at)linux(dot)com>
Cc: <robertmhaas(at)gmail(dot)com>,<pgsql-hackers(at)postgresql(dot)org>, <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: Command Triggers, patch v11
Date: 2012-03-03 16:12:54
Message-ID: 4F51EEA60200002500045ED5@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> Thom Brown wrote:
> Dimitri Fontaine wrote:
>> Thom Brown writes:
>>> problem. It was the DROP COMMAND TRIGGER statement that garnered
>>> comment, as it makes more sense to drop the entire trigger than
>>> individual commands for that trigger.
>>
>> What you're saying here is that a single command could have more
>> than one command attached to it, and what I understand Tom, Robert
>> and Kevin are saying is that any given command trigger should only
>> be attached to a single command.
>
> I hadn't interpreted it that way

Nor had I.

> I'm still of the opinion that a single command trigger should be
able to attach to multiple commands, just not
> amendable once the trigger has been created.

That was my understanding of what we were discussing, too.

> So my vote was for:
>
> CREATE COMMAND TRIGGER name { BEFORE | AFTER } command [, ... ]
> EXECUTE PROCEDURE function_name ()
>
> ALTER COMMAND TRIGGER name SET enabled
>
> DROP COMMAND TRIGGER [ IF EXISTS ] name [ CASCADE | RESTRICT ]

Same here.

> My argument for this is that you may wish to implement the same
> trigger for tables, views and foreign tables rather than create 3
> separate triggers.

Right. What I thought I was agreeing with was the notion that you
should need to specify more than the trigger name to drop the
trigger. Rather like how you can create a trigger AFTER INSERT OR
UPDATE OR DELETE, but you don't need to specify all those events to
drop the trigger -- just the name will do.

-Kevin

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thom Brown 2012-03-03 16:21:33 Re: Command Triggers, patch v11
Previous Message Thom Brown 2012-03-03 15:55:35 Re: Command Triggers, patch v11