poll: CHECK TRIGGER?

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема poll: CHECK TRIGGER?
Дата
Msg-id 1330807185-sup-2696@alvh.no-ip.org
обсуждение исходный текст
Ответы Re: poll: CHECK TRIGGER?
Список 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 по дате отправления:

Предыдущее
От: "Kevin Grittner"
Дата:
Сообщение: Re: COPY with hints, rebirth
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: review: CHECK FUNCTION statement