Re: After each row trigger NOT seeing data changes?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: After each row trigger NOT seeing data changes?
Дата
Msg-id 14635.1242938182@sss.pgh.pa.us
обсуждение исходный текст
Ответ на After each row trigger NOT seeing data changes?  (Karl Nack <karlnack@futurityinc.com>)
Ответы Re: After each row trigger NOT seeing data changes?  (Raymond O'Donnell <rod@iol.ie>)
Re: After each row trigger NOT seeing data changes?  (Karl Nack <karlnack@futurityinc.com>)
Re: After each row trigger NOT seeing data changes?  (Bruce Momjian <bruce@momjian.us>)
Список pgsql-general
Karl Nack <karlnack@futurityinc.com> writes:
> I notice the row count does not reflect the newly-inserted row, which
> suggests that the trigger is not seeing changes made to the table. This
> seems to be exactly opposite of what's in the manual:
> http://www.postgresql.org/docs/8.3/interactive/trigger-datachanges.html
> http://www.postgresql.org/docs/8.3/interactive/trigger-example.html

The reason is that you've declared the function STABLE, which causes it
to use the calling query's starting snapshot.  So it cannot see any
in-progress changes of the calling query.  Declare it VOLATILE (or
let it default to that) and it will act as you expect.

I'm not sure if the cited portions of the manual ought to contain notes
about this or not.  It seems a bit off-topic for them, but if other
people have been bit by this, then maybe ... comments anyone?

            regards, tom lane

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

Предыдущее
От: Karl Nack
Дата:
Сообщение: After each row trigger NOT seeing data changes?
Следующее
От: Rodrigo Gonzalez
Дата:
Сообщение: Re: After each row trigger NOT seeing data changes?