Обсуждение: pltcl: Invalid return list from trigger - must have even # of elements

Поиск
Список
Период
Сортировка

pltcl: Invalid return list from trigger - must have even # of elements

От
"Ian Harding"
Дата:
I kept getting this darned error from an AFTER trigger and I don't know why.  The portion of the code that was
exerciseddid a couple selects, but no update, insert or delete on any other table, so that would seem to eliminate
anothertrigger sending this error.   

How did I fix it, you ask?  I noticed that tcl comments (lines starting with #) had some effect.  I deleted all my
comments,and all is well.  However, there are some "elog DEBUG" lines in there that seem to be critical, if I remove
them,the same error comes up. 

I can and will work up a simple test case so you all can reproduce it, but before I go to the effort, is this a known
issue? I have found nothing about it in the docs or google search. 

From what I read in the docs, the return value, if any, from a pltcl trigger function is ignored if it is an AFTER
trigger,right? 

Ian A. Harding
Programmer/Analyst II
Tacoma-Pierce County Health Department
(253) 798-3549
mailto: iharding@tpchd.org


Re: pltcl: Invalid return list from trigger - must have even # of elements

От
Tom Lane
Дата:
"Ian Harding" <ianh@tpchd.org> writes:
> I kept getting this darned error from an AFTER trigger and I don't
> know why.

A quick look at the pltcl sources shows that pltcl expects a valid
result from both BEFORE and AFTER triggers.  You did not say what
you were returning from your trigger, but I'd suggest returning "OK".

The docs do say that an AFTER trigger's result is ignored, so maybe
we should make that happen for 7.3.

            regards, tom lane