Re: loop with circular updates

From: Jessica M Salmon <jmsalmon(at)fs(dot)fed(dot)us>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: loop with circular updates
Date: 2006-07-28 13:25:49
Message-ID: OF943EFD7A.9C30B5E1-ON872571B9.00495B68-872571B9.0049C65B@fs.fed.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I'm not sure if my second email made it through; I haven't seen it on the
website yet. But, basically, what I am asking is this:
-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?
and if so, then I am wondering:
-if I then update one of the records currently in memory, are these
changes visible when the loop gets to it?

I hope that someone can tell me these things.
Thanks,
Meghan


Kenneth Downs
<ken(at)secdat(dot)com>
To
07/26/2006 08:50 Jessica M Salmon
AM <jmsalmon(at)fs(dot)fed(dot)us>
cc
pgsql-general(at)postgresql(dot)org
Subject
Re: [GENERAL] loop with circular
updates





Jessica M Salmon wrote:

>Hi All.
>
>I'm writing a plpgsql function that creates a table and loops over the
>items in that table, using a FOR ... IN EXECUTE ... loop. The thing is, on
>each iteration I update the table over which I am looping. Sometimes, the
>result of this update makes it no longer necessary/desirable to process
>subsequent records in the loop.
>
>
Can you tell us more about the app? Sounds like an ERP allocation or
something like that.

(See attached file: ken.vcf)

Attachment Content-Type Size
ken.vcf application/octet-stream 197 bytes

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2006-07-28 13:29:12 Re: What's special about 1916-10-01 02:25:20? Odd jump in internal timestamptz representation
Previous Message Alistair Bayley 2006-07-28 12:33:29 Re: What's special about 1916-10-01 02:25:20? Odd jump in internal timestamptz representation