Is it possible to use an EVENT TRIGGER to validate a TRIGGER?

From: Luís Eduardo Oliveira Lizardo <lizardo(dot)luis(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Is it possible to use an EVENT TRIGGER to validate a TRIGGER?
Date: 2016-07-06 00:08:33
Message-ID: CAGOcHe4a983Bb5-E4_ZGs5G8+-RvPRsDGMxCwA8+kn3Leh2how@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

Is it possible to use an EVENT TRIGGER to validate a TRIGGER definition?

What I want is to guarantee that the trigger is fired AFTER a STATEMENT, on
INSERT or UPDATE but not on DELETE, like the following example:

CREATE TRIGGER mytrigger
AFTER INSERT OR UPDATE ON mytable
FOR EACH STATEMENT
EXECUTE PROCEDURE myprocedure();

I know I can check those parameters inside the trigger function with TG_OP,
TG_WHEN and TG_LEVEL, but in this way, it only checks if the trigger is
correct during an insertion, upload or deletion, and not right after the
trigger definition.

Best regards,

Luis Lizardo

Responses

Browse pgsql-general by date

  From Date Subject
Next Message 苏士涛 2016-07-06 02:37:40 How sync settings or extensions in streaming replication
Previous Message David G. Johnston 2016-07-05 22:28:25 Re: Possible to create canonicalized range type without being superuser?