Re: Command Triggers, patch v11 - Mailing list pgsql-hackers

From Thom Brown
Subject Re: Command Triggers, patch v11
Date
Msg-id CAA-aLv7rKY2i-uezD_=3fxu1QqnV1nHBkj71avWQzOqzWxrTHw@mail.gmail.com
Whole thread Raw
In response to Re: Command Triggers, patch v11  (Dimitri Fontaine <dimitri@2ndQuadrant.fr>)
Responses Re: Command Triggers, patch v11  (Dimitri Fontaine <dimitri@2ndQuadrant.fr>)
List pgsql-hackers
On 3 March 2012 13:45, Dimitri Fontaine <dimitri@2ndquadrant.fr> wrote:
> Robert Haas <robertmhaas@gmail.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


pgsql-hackers by date:

Previous
From: Dimitri Fontaine
Date:
Subject: Re: Command Triggers, patch v11
Next
From: Yeb Havinga
Date:
Subject: Re: [v9.2] Add GUC sepgsql.client_label