Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VgLbw-0003EY-S5 for pgsql-bugs@arkaria.postgresql.org; Tue, 12 Nov 2013 21:35:01 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VgLbv-0006Ps-Gv for pgsql-bugs@arkaria.postgresql.org; Tue, 12 Nov 2013 21:34:59 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VgLbt-0006Pj-Gd for pgsql-bugs@postgresql.org; Tue, 12 Nov 2013 21:34:57 +0000 Received: from sam.nabble.com ([216.139.236.26]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VgLbq-0005aE-Si for pgsql-bugs@postgresql.org; Tue, 12 Nov 2013 21:34:56 +0000 Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1VgLbp-0004VJ-Rp for pgsql-bugs@postgresql.org; Tue, 12 Nov 2013 13:34:53 -0800 Date: Tue, 12 Nov 2013 13:34:53 -0800 (PST) From: David Johnston To: pgsql-bugs@postgresql.org Message-ID: <1384292093855-5777999.post@n5.nabble.com> In-Reply-To: <11851.1384285210@sss.pgh.pa.us> References: <11851.1384285210@sss.pgh.pa.us> Subject: Re: BUG #8448: looping through query results exits at 10th step under some conditions MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: 3.7 (+++) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org 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. -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs