Re: trigger functions broken?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: trigger functions broken?
Дата
Msg-id 901.1223506584@sss.pgh.pa.us
обсуждение исходный текст
Ответ на trigger functions broken?  (Alvaro Herrera <alvherre@commandprompt.com>)
Список pgsql-hackers
Alvaro Herrera <alvherre@commandprompt.com> writes:
> Trigger functions are supposed to be able to be called only as triggers,
> but apparently the check is not working in CVS HEAD:

I traced through this, and what is happening is that the validator's
trial compilation of the function doesn't complain (as indeed it
shouldn't) but then it produces a function cache entry that successfully
matches the non-trigger call later.  Since the error check is made while
compiling, it doesn't happen during that call.  So the proximate cause
is that compute_function_hashkey() is failing to ensure that the hash
keys are distinct in the two cases.

You do get an error when you try to call the function in a session other
than the one that defined it.

I wonder whether we should allow the validator to produce a persistent
cache entry at all.  I guess in simple cases (not trigger, not
polymorphic) the validator's compilation is perfectly fine, but it
seems like trouble waiting to happen.
        regards, tom lane


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

Предыдущее
От: "Kevin Grittner"
Дата:
Сообщение: Re: 8.4devel out of memory
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: [WIP] plpgsql is not translate-aware