Re: BUG #8448: looping through query results exits at 10th step under some conditions

Поиск
Список
Период
Сортировка
От David Johnston
Тема Re: BUG #8448: looping through query results exits at 10th step under some conditions
Дата
Msg-id 1384292093855-5777999.post@n5.nabble.com
обсуждение исходный текст
Ответ на Re: BUG #8448: looping through query results exits at 10th step under some conditions  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Re: BUG #8448: looping through query results exits at 10th step under some conditions
Список pgsql-bugs
Tom Lane-2 wrote
> 1. Leave the code alone, but document that the prefetching behavior
> exists.
> Users who run into this are on their own to work around it.

1a.  Leave the code alone and expect that occasionally users will encounter
this problem, post to the bugs/general list, and the community helps them
figure out how to overcome the problem in their specific case.

Even though the OPs test case proves the bug exists the fact that it makes
no sense indeed makes it hard to get excited about proactively preventing
this situation.  Convention for updating within a loop is that you'd update
the current record on each iteration - not past or future records (which is
happening implicitly here because of the CROSS JOIN).  A proper update
statement, possibly with a RETURNING clause, is often going to be the better
solution anyway.

So, is there an underlying use-case driving this complaint that should be
considered by the community either to induce a fix to the behavior or just
to solicit suggestions for better alternatives?

David J.




--
View this message in context:
http://postgresql.1045698.n5.nabble.com/BUG-8448-looping-through-query-results-exits-at-10th-step-under-some-conditions-tp5770594p5777999.html
Sent from the PostgreSQL - bugs mailing list archive at Nabble.com.

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #8448: looping through query results exits at 10th step under some conditions
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: BUG #8588: Need work arounds for Apple unaligned access