pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David Johnston <polobo@yahoo.com>
To: pgsql-bugs@postgresql.org
Subject: Re: BUG #8448: looping through query results exits at 10th step under some conditions
Date: Tue, 12 Nov 2013 13:34:53 -0800 (PST)
Message-ID: <1384292093855-5777999.post@n5.nabble.com> (raw)
In-Reply-To: <11851.1384285210@sss.pgh.pa.us>
References: <E1VK84r-0004zz-33@wrigleys.postgresql.org>
	<11851.1384285210@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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-un...
Sent from the PostgreSQL - bugs mailing list archive at Nabble.com.


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (4+ messages)  latest in thread

Message-ID: <1384292093855-5777999.post@n5.nabble.com>
Permalink:  ../1384292093855-5777999.post@n5.nabble.com/
Also on:    postgresql.org/message-id/1384292093855-5777999.post@n5.nabble.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: polobo@yahoo.com
  Subject: Re: BUG #8448: looping through query results exits at 10th step under some conditions
  In-Reply-To: <1384292093855-5777999.post@n5.nabble.com>
  References: <E1VK84r-0004zz-33@wrigleys.postgresql.org> <11851.1384285210@sss.pgh.pa.us> <1384292093855-5777999.post@n5.nabble.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox