Is it possible to use an EVENT TRIGGER to validate a TRIGGER? - Mailing list pgsql-general

From Luís Eduardo Oliveira Lizardo
Subject Is it possible to use an EVENT TRIGGER to validate a TRIGGER?
Date
Msg-id CAGOcHe4a983Bb5-E4_ZGs5G8+-RvPRsDGMxCwA8+kn3Leh2how@mail.gmail.com
Whole thread Raw
Responses Re: Is it possible to use an EVENT TRIGGER to validate a TRIGGER?  (Alvaro Herrera <alvherre@2ndquadrant.com>)
List 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

pgsql-general by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: Possible to create canonicalized range type without being superuser?
Next
From: 苏士涛
Date:
Subject: How sync settings or extensions in streaming replication