Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fqftx-0008Cs-CU for pgsql-bugs@arkaria.postgresql.org; Fri, 17 Aug 2018 14:38:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fqftv-0002lC-Oc for pgsql-bugs@arkaria.postgresql.org; Fri, 17 Aug 2018 14:38:55 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fqftv-0002Zh-EP for pgsql-bugs@lists.postgresql.org; Fri, 17 Aug 2018 14:38:55 +0000 Received: from lungold.riddles.org.uk ([82.68.208.19]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fqftm-0007ly-Ty for pgsql-bugs@lists.postgresql.org; Fri, 17 Aug 2018 14:38:52 +0000 Received: from [192.168.127.1] (port=53302 helo=caithnard.riddles.org.uk) by lungold.riddles.org.uk with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.88 (FreeBSD)) (envelope-from ) id 1fqfti-000DTF-HR; Fri, 17 Aug 2018 14:38:42 +0000 Received: from [127.0.0.1] (port=46313 helo=caithnard.riddles.org.uk) by caithnard.riddles.org.uk with esmtp (Exim 4.89 (FreeBSD)) (envelope-from ) id 1fqfth-000G9i-Pv; Fri, 17 Aug 2018 14:38:41 +0000 From: Andrew Gierth To: Alvaro Herrera Cc: pgsql-bugs@lists.postgresql.org, v.g.baranoff@gmail.com, Tom Lane Subject: Re: BUG #15336: Wrong cursor's bacward fetch results in select with ALL(subquery) In-Reply-To: <20180817140411.crhfn3machmctt7n@alvherre.pgsql> (Alvaro Herrera's message of "Fri, 17 Aug 2018 11:04:11 -0300") Message-ID: <87efex2hd2.fsf@news-spur.riddles.org.uk> References: <20180817140411.crhfn3machmctt7n@alvherre.pgsql> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (berkeley-unix) Date: Fri, 17 Aug 2018 15:38:41 +0100 MIME-Version: 1.0 Content-Type: text/plain List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk >>>>> "Alvaro" == Alvaro Herrera writes: >> I wonder if we have a contender here for the oldest reported bug in >> PG history; while I haven't tested anything older than 9.5, the >> incorrect logic seems to date back to the introduction of subqueries >> in 6.something. Alvaro> Hmm .. Alvaro> 8.2 seems fine: Hah. You're right; the bug is only 10 years old, not 20. It was apparently introduced in 8.3 by commit c7ff7663e; before that, SubPlans had a separate EState from the parent plan, so they didn't share the parent plan's direction indicator. -- Andrew (irc:RhodiumToad)