Re: Command Triggers

Dimitri Fontaine <dimitri@2ndquadrant.fr>

From: Dimitri Fontaine <dimitri@2ndQuadrant.fr>
To: Dimitri Fontaine <dimitri@2ndQuadrant.fr>
Cc: Robert Haas <robertmhaas@gmail.com>, Simon Riggs <simon@2ndquadrant.com>, Tom Lane <tgl@sss.pgh.pa.us>, Alvaro Herrera <alvherre@commandprompt.com>, Andres Freund <andres@anarazel.de>, Pg Hackers <pgsql-hackers@postgresql.org>, Greg Smith <greg@2ndquadrant.com>, Bruce Momjian <bruce@momjian.us>
Date: 2012-02-17T17:06:05Z
Lists: pgsql-hackers
Dimitri Fontaine <dimitri@2ndQuadrant.fr> writes:
>>>> I think it would be better to bail on trying to use CREATE TRIGGER and
>>>> DROP TRIGGER as a basis for this functionality, and instead create
>>>> completely new toplevel statements CREATE COMMAND TRIGGER and DROP
>>>> COMMAND TRIGGER.  Then, you could decide that all command triggers
>>>> live in the same namespace, and therefore to get rid of the command
>>>> trigger called bob you can just say "DROP COMMAND TRIGGER bob",
>>>> without having to specify the type of command it applies to.  It's
>
> I guess that's a point to change the grammar the way you're hinting:
>
>   CREATE COMMAND TRIGGER
>   DROP COMMAND TRIGGER
>   ALTER COMMAND TRIGGER
>
> That also needs each their own reference page.  It will be easier on the
> users I guess.  Will work on that.

FWIW I've pushed such a change to my github repository, I'm not spamming
the list with v10 already though, unless someone wants to see it.

  https://github.com/dimitri/postgres/commit/82996b45aae10f12818f1e3097ba805fff22a97b

Regards,
-- 
Dimitri Fontaine
http://2ndQuadrant.fr     PostgreSQL : Expertise, Formation et Support