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

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Luís Eduardo Oliveira Lizardo <lizardo(dot)luis(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Is it possible to use an EVENT TRIGGER to validate a TRIGGER?
Date: 2016-07-06 03:02:07
Message-ID: 20160706030207.GA608057@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Luís Eduardo Oliveira Lizardo wrote:
> 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:

What you can do with a C language function in 9.5 is to examine the
CreateTrigger struct and verify that it matches the conditions you want.
So, yes, it's possible, but not in plpgsql.

--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Paul A Jungwirth 2016-07-06 05:17:06 Re: Possible to create canonicalized range type without being superuser?
Previous Message Michael Paquier 2016-07-06 02:46:31 Re: How sync settings or extensions in streaming replication