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 1fqdFx-0000Rp-Do for pgsql-bugs@arkaria.postgresql.org; Fri, 17 Aug 2018 11:49:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fqdFv-00048H-Mc for pgsql-bugs@arkaria.postgresql.org; Fri, 17 Aug 2018 11:49:27 +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 1fqdFv-00048A-DK for pgsql-bugs@lists.postgresql.org; Fri, 17 Aug 2018 11:49:27 +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 1fqdFr-0003vI-CW for pgsql-bugs@lists.postgresql.org; Fri, 17 Aug 2018 11:49:26 +0000 Received: from [192.168.127.1] (port=53957 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 1fqdFo-000DFp-Ho; Fri, 17 Aug 2018 11:49:20 +0000 Received: from [127.0.0.1] (port=22566 helo=caithnard.riddles.org.uk) by caithnard.riddles.org.uk with esmtp (Exim 4.89 (FreeBSD)) (envelope-from ) id 1fqdFn-00074w-Sz; Fri, 17 Aug 2018 11:49:20 +0000 From: Andrew Gierth To: pgsql-bugs@lists.postgresql.org Cc: v.g.baranoff@gmail.com Subject: Re: BUG #15336: Wrong cursor's bacward fetch results in select with ALL(subquery) In-Reply-To: <87va892tf5.fsf@news-spur.riddles.org.uk> (Andrew Gierth's message of "Fri, 17 Aug 2018 11:27:46 +0100") Message-ID: <87mutl2pv1.fsf@news-spur.riddles.org.uk> References: <153449812167.1304.1741624125628126322@wrigleys.postgresql.org> <87va892tf5.fsf@news-spur.riddles.org.uk> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (berkeley-unix) Date: Fri, 17 Aug 2018 12:49:19 +0100 MIME-Version: 1.0 Content-Type: text/plain List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk >>>>> "Andrew" == Andrew Gierth writes: Andrew> I'm really not sure yet what the correct fix is, though. I'm guessing that locally saving/restoring the scan direction in ExecSubPlan is going to be the best option; it seems to fix the problem, I'll post a patch in a bit. -- Andrew (irc:RhodiumToad)