plperl and triggers
От | James Cloos |
---|---|
Тема | plperl and triggers |
Дата | |
Msg-id | m3slizm5me.fsf@lugabout.jhcloos.org обсуждение исходный текст |
Ответы |
Re: plperl and triggers
|
Список | pgsql-docs |
The manual says that $_TD->{old} contains the old value of the row being operated on in a trigger, and $_TD->{new} the new value to be used istead. When using plpgsql I find that the equivs OLD and NEW do work that way, but with plperlu there was only $_TD->{new}. Perhaps {old} is only set on an update. Or on an AFTER trigger to an insert? Or perhaps {old} only gets set if {new} is altered? Whatever the reality, the doc should be fixed to explain exactly when {old} and {new} exist and their semantics. Liberal use of, eg, elog(WARNING, Dumper(\$_TD)) made it easy to get my trigger function working as desired, but it would be cool to document the details.... (In general, the docs are great. I do sometimes have to read a given section more than once -- or thrice -- to get it, but that is as much due to fatigue as anything. And I am one of those who tend to learn new stuff better when reading from paper than from emitive displays like lcds or crts, for whatever reason.) (Or maybe I'm just getting old. ;-) -JimC -- James Cloos <cloos@jhcloos.com> OpenPGP: 0xED7DAEA6
В списке pgsql-docs по дате отправления: