Triggers on transaction?

Поиск
Список
Период
Сортировка
От Jordan Gigov
Тема Triggers on transaction?
Дата
Msg-id CA+nBocCxTd64U8pteO172VfEZfSavu31oqZK2GzwGf05k7G_6A@mail.gmail.com
обсуждение исходный текст
Ответы Re: Triggers on transaction?  (Marko Tiikkaja <marko@joh.to>)
Список pgsql-hackers
I found myself in need of triggers that are run only once per transaction, rather than per row or statement within the transaction. Meaning it will always be deferred and never called twice for the same transaction.

Perhaps in 9.6 this part of syntax for trigger creation can be changed from:
[ FOR [ EACH ] { ROW | STATEMENT } ]
to:
[ FOR [ EACH ] { ROW | STATEMENT | TRANSACTION } ]
I looked though the code get an idea of how difficult it would be to implement and I think I might be able to do it, at least for functions without parameters. My idea for functions with parameters is to have them constrained to each one only accepting arrays of the type of element that is passed. Meaning if the column type is integer[], the function must take integer[][] in that parameter. From then on it's a matter of choice whether they'll be passed at original order or reverse and whether the trigger execution will be moved back or not.

Should I bother trying or will such a feature not be accepted into a final release, even if it's working?

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Guillaume Lelarge
Дата:
Сообщение: Re: about lob(idea)
Следующее
От: Marko Tiikkaja
Дата:
Сообщение: Re: Triggers on transaction?