Re: stable for each row before insert trigger
От | Олег Самойлов |
---|---|
Тема | Re: stable for each row before insert trigger |
Дата | |
Msg-id | 96A6DF7B-1E5C-4900-A253-F53FD94FB071@ya.ru обсуждение исходный текст |
Ответ на | Re: stable for each row before insert trigger (Adrian Klaver <adrian.klaver@aklaver.com>) |
Список | pgsql-general |
Eh, stupid answer. Of cause, I read the documentation. But what about you? Do you know what is a trigger function? (for eachrow before insert) A trigger function don't have parameters, instead it get special variables. OLD and NEW for instance or TG_ARGV[]. If trigger function depends only on NEW is it IMMUTABLE? (With the same NEW it must return the same changed NEW). If triggerfunction makes SELECTs and change only NEW is it can be declared as STABLE? And etc. > 18 окт. 2019 г., в 2:41, Adrian Klaver <adrian.klaver@aklaver.com> написал(а): > > On 10/17/19 4:31 PM, Олег Самойлов wrote: >> Hi all. >> According to documentation the words "VOLATILE, STABLE, IMMUTABLE" is somehow useful with trigger functions, for instancementioned that the AFTER INSERT trigger should be VOLATILE. The question is how this words affect a for each rowbefore insert trigger? Can be some optimisation here? > > https://www.postgresql.org/docs/11/xfunc-volatility.html > > -- > Adrian Klaver > adrian.klaver@aklaver.com
В списке pgsql-general по дате отправления: