Re: SPI and CommandCounterIncrement, redux

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: SPI and CommandCounterIncrement, redux
Дата
Msg-id 13400.1006353563@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: SPI and CommandCounterIncrement, redux  ("Zeugswetter Andreas SB SD" <ZeugswetterA@spardat.at>)
Список pgsql-hackers
"Zeugswetter Andreas SB SD" <ZeugswetterA@spardat.at> writes:
>> Note the failure to display "Name :: name4".  The problem is that
>> no CommandCounterIncrement happens between the second INSERT and
>> the FOR ... SELECT, so the inserted row is considered not yet visible.

> I wonder why the insert does not do the CommandCounterIncrement,
> since it is a statement that did modification and all subsequent 
> statements should see the effect ?
> In other places this is the usual practice (CommandCounterIncrement
> after modification), no ?

SPI's habit is to do CommandCounterIncrement *before* it starts a query,
rather than after.  I think this makes sense, since otherwise we'd have
to do a CommandCounterIncrement at the start of every function call,
whether the function contained any subqueries or not.
        regards, tom lane


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

Предыдущее
От: Thomas Lockhart
Дата:
Сообщение: Regression tests need updating...
Следующее
От: Tom Lane
Дата:
Сообщение: Re: internals.ps