Re: loop with circular updates

From: Jessica M Salmon <jmsalmon(at)fs(dot)fed(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: loop with circular updates
Date: 2006-07-28 15:47:45
Message-ID: OF2C007758.57DC9A05-ON872571B9.0056B1FA-872571B9.0056C4F1@fs.fed.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Tom,

Yes, I see. good to get that straightened out in my head, thank you.

-Meghan


Tom Lane
<tgl(at)sss(dot)pgh(dot)pa(dot)u
s> To
Jessica M Salmon
07/28/2006 09:46 <jmsalmon(at)fs(dot)fed(dot)us>
AM cc
pgsql-general(at)postgresql(dot)org
Subject
Re: [GENERAL] loop with circular
updates





Jessica M Salmon <jmsalmon(at)fs(dot)fed(dot)us> writes:
> -is it true that when looping over query results in a plpgsql
> for..in..execute loop, several records are stored in memory at one time?

Yes, but that's got nothing to do with your issue.

> -if I then update one of the records currently in memory, are these
> changes visible when the loop gets to it?

*All* queries in Postgres see a snapshot as of the instant of query
start. This is a property of the MVCC rules and has nothing to do with
buffering. What's returned by a FOR IN EXECUTE is whatever was in the
database when the loop began.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Sandeep Kumar Jakkaraju 2006-07-28 16:06:01 Help
Previous Message Tom Lane 2006-07-28 15:46:08 Re: loop with circular updates