
> 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 ?
Or is this a stupid question.

Andreas

Wed, 21 Nov 2001 10:06:47 +0100
"Zeugswetter Andreas SB SD" <ZeugswetterA@spardat.at>
Re: SPI and CommandCounterIncrement, redux
"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

Wed, 21 Nov 2001 09:39:23 -0500
Tom Lane <tgl@sss.pgh.pa.us>
Re: SPI and CommandCounterIncrement, redux 