Re: Command Triggers, patch v11

From: Thom Brown <thom(at)linux(dot)com>
To: Dimitri Fontaine <dimitri(at)2ndquadrant(dot)fr>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Command Triggers, patch v11
Date: 2012-03-03 14:03:01
Message-ID: CAA-aLv7rKY2i-uezD_=3fxu1QqnV1nHBkj71avWQzOqzWxrTHw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 3 March 2012 13:45, Dimitri Fontaine <dimitri(at)2ndquadrant(dot)fr> wrote:
> Robert Haas <robertmhaas(at)gmail(dot)com> writes:
>>>>       CREATE COMMAND TRIGGER name ... properties ...;
>>>>       DROP COMMAND TRIGGER name;
>>>>
>>>> full stop.  If you want to run the same trigger function on some
>>>> more commands, add another trigger name.
>>>
>>> +1
>>
>> +1.  I suggested the same thing a while back.
>
> Yeah, I know, I just wanted to hear from more people before ditching out
> a part of the work I did, and Thom was balancing in the opposite
> direction.

I was? I agreed with Tom's comment, but I did query your
interpretation of it with regards to the CREATE COMMAND TRIGGER
statement. It seems you removed the ability to create a command
trigger against multiple commands, but I don't think that was the
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. Initially I had proposed a way
to drop all commands on a trigger at once as an additional option, but
just dropping it completely or not at all is preferable.

But if there is agreement to have multiple commands on a command
trigger, I'm wondering whether we should have an OR separator rather
than a comma? The reason is that regular triggers define a list of
statements this way. Personally I prefer the comma syntax, but my
concern (not a strong concern) is for lack of consistency.

--
Thom

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Yeb Havinga 2012-03-03 14:12:33 Re: [v9.2] Add GUC sepgsql.client_label
Previous Message Dimitri Fontaine 2012-03-03 13:45:10 Re: Command Triggers, patch v11