Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rYxaj-001BZ6-0k for pgsql-admin@arkaria.postgresql.org; Sun, 11 Feb 2024 00:21:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rYxah-000aKU-DG for pgsql-admin@arkaria.postgresql.org; Sun, 11 Feb 2024 00:21:03 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rYxah-000aKL-2E for pgsql-admin@lists.postgresql.org; Sun, 11 Feb 2024 00:21:03 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rYxab-006YkA-Jl for pgsql-admin@postgresql.org; Sun, 11 Feb 2024 00:21:02 +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 41B0KsaC1912062; Sat, 10 Feb 2024 19:20:54 -0500 From: Tom Lane To: Wells Oliver cc: pgsql-admin Subject: Re: Temp table + inde + FDW table on Redshift: MOVE BACKWARD ALL IN not supported In-reply-to: References: Comments: In-reply-to Wells Oliver message dated "Sat, 10 Feb 2024 15:35:53 -0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1912060.1707610854.1@sss.pgh.pa.us> Date: Sat, 10 Feb 2024 19:20:54 -0500 Message-ID: <1912061.1707610854@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Wells Oliver writes: > Hi all. This might be a Redshift-specific issue and if so, I apologize for > posting here, but there might be something more general with FDW, indexes, > and temp tables going on too, so I thought I'd post. > ... > The query runs for a split second, you can see some results, and then bombs: > ERROR: SQL command "MOVE BACKWARD ALL IN c1" not supported. > CONTEXT: remote SQL command: MOVE BACKWARD ALL IN c1 You didn't show an EXPLAIN, but it looks like the FDW is expecting the remote server to support something it doesn't. I'd guess that you need a Redshift-specific FDW to make this work reliably. You could possibly work around it by forcing the planner to use a different join method. regards, tom lane