Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pstOj-0004N8-JC for pgsql-bugs@arkaria.postgresql.org; Sat, 29 Apr 2023 22:50:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pstOh-0000d8-3Y for pgsql-bugs@arkaria.postgresql.org; Sat, 29 Apr 2023 22:50:31 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pstOg-0000cz-RE for pgsql-bugs@lists.postgresql.org; Sat, 29 Apr 2023 22:50:30 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1pstOd-005qmL-BZ for pgsql-bugs@lists.postgresql.org; Sat, 29 Apr 2023 22:50:30 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 33TMoOYK1852636; Sat, 29 Apr 2023 18:50:24 -0400 From: Tom Lane To: Etsuro Fujita cc: eric.cyr@gmail.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #17889: Invalid cursor direction for a foreign scan that reached the fetch_size (MOVE BACKWARD ALL IN cX) In-reply-to: References: <17889-e8c39a251d258dda@postgresql.org> Comments: In-reply-to Etsuro Fujita message dated "Sat, 29 Apr 2023 20:42:02 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1852634.1682808624.1@sss.pgh.pa.us> Date: Sat, 29 Apr 2023 18:50:24 -0400 Message-ID: <1852635.1682808624@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Etsuro Fujita writes: >> I think that the root cause is in commit d844cd75a, which disallowed >> rewinding and then re-fetching forwards in a NO SCROLL cursor. I am >> not sure what to do about this issue, but I am wondering whether that >> commit is too restrictive, because 1) these examples would work just >> fine without that commit, and 2) we still allow >> rewind-and-fetch-forwards in a SCROLL cursor even when the query >> includes volatile functions. Well, the short answer here is that postgres_fdw is depending on something that has squishy semantics, for the reasons enumerated in d844cd75a (see also [1]). Maybe we can carve out an exception that's narrow enough that we can convince ourselves it's not squishy, but I'm not very sure what the rules should be. regards, tom lane [1] https://www.postgresql.org/message-id/201144.1682350828%40sss.pgh.pa.us