loop with circular updates

Поиск
Список
Период
Сортировка
От Jessica M Salmon
Тема loop with circular updates
Дата
Msg-id OFB38A84F4.BBFB72A2-ON872571B6.00775029-872571B6.00781153@fs.fed.us
обсуждение исходный текст
Ответы Re: loop with circular updates  (Kenneth Downs <ken@secdat.com>)
Список pgsql-general
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.

My results are confusing me, and I was wondering if it is possible that my
method doesn't work considering how postgres holds query results in memory
for loops. I read somewhere that it caches several records at a time,
retrieving more as needed. If this is the case (is it?), and I updated a
field of an item that is already cached, would I then see that change when
I retrieved that item in the loop?

I feel like this is a difficult concept to illustrate with words. Perhaps
my pl/pgsql vocabulary is still too small for asking this question, but I'm
hoping that someone here can see my concern and tell me whether or not I am
barking up the right tree, so to speak.

Thanks,
Meghan


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

Предыдущее
От: "Tom Kinard"
Дата:
Сообщение: Database Restore errors
Следующее
От: "chris997"
Дата:
Сообщение: Re: "Ghost" colmumn with primary key