poll: CHECK TRIGGER? - Mailing list pgsql-hackers

From Alvaro Herrera
Subject poll: CHECK TRIGGER?
Date
Msg-id 1330807185-sup-2696@alvh.no-ip.org
Whole thread Raw
Responses Re: poll: CHECK TRIGGER?
List pgsql-hackers
Hi,

Pavel's patch for CHECK FUNCTION is adding another command besides that
one, which is CHECK TRIGGER.  The idea behind this is that you give it
the relation to which the trigger is attached in addition to the trigger
name, and it checks the function being called by that trigger.

IMHO having a separate command for this is not warranted.  It seems to
me that we could simply have a variant of CREATE FUNCTION for this; I
proposed CREATE FUNCTION trigfunc() AS TRIGGER ON tabname.  Besides,
it's really the function code being checked, not the trigger itself; the
trigger is only providing the tuple descriptor for NEW and OLD.

Pavel didn't like this idea; also, a quick poll on twitter elicited only
two answers: Dimitri Fontaine prefers CHECK TRIGGER, and Guillaume
Lelarge prefers CHECK FUNCTION.

So I still don't know which route to go with this.  Thoughts?

One thing to consider is eventual support for triggers that use
anonymous function blocks, without a previous CREATE FUNCTION, which is
being discussed in another thread.  Another point is that CHECK TRIGGER
requires a separate documentation page.

--
Álvaro Herrera <alvherre@alvh.no-ip.org>


pgsql-hackers by date:

Previous
From: "Kevin Grittner"
Date:
Subject: Re: COPY with hints, rebirth
Next
From: Alvaro Herrera
Date:
Subject: Re: review: CHECK FUNCTION statement