Re: DML fails after updatable cursor is used with trigger returning function

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: DML fails after updatable cursor is used with trigger returning function
Дата
Msg-id 22169.1193870215@sss.pgh.pa.us
обсуждение исходный текст
Ответ на DML fails after updatable cursor is used with trigger returning function  ("Dharmendra Goyal" <dharmendra.goyal@gmail.com>)
Список pgsql-hackers
"Dharmendra Goyal" <dharmendra.goyal@gmail.com> writes:
> I created one function which updates a table using updatable cursor. I wrote
> one trigger also on the same table. When i execute the function it gives
> expected results.  But after that all DMLs fail.

The problem is that your trigger function recursively invokes itself.

If you used an unbound cursor variable (so that the portal name gets
selected dynamically) you could avoid the conflict of cursor name
between inner and outer executions, but you'd still need to do something
about avoiding infinite recursion.  Also, closing a cursor when done
with it would be a real good idea.
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: psql show dbsize?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Postgresql 8.3 beta crash