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 1trjbv-008WEV-Fl for pgsql-bugs@arkaria.postgresql.org; Mon, 10 Mar 2025 20:20:27 +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 1trjbt-00HPF5-Fr for pgsql-bugs@arkaria.postgresql.org; Mon, 10 Mar 2025 20:20:25 +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 1trjbt-00HPEq-7X for pgsql-bugs@lists.postgresql.org; Mon, 10 Mar 2025 20:20:25 +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.96) (envelope-from ) id 1trjbp-0026L1-2N for pgsql-bugs@lists.postgresql.org; Mon, 10 Mar 2025 20:20:24 +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 52AKKKML1214518; Mon, 10 Mar 2025 16:20:20 -0400 From: Tom Lane To: Dean Rasheed cc: Tender Wang , Duncan Sands , pgsql-bugs@lists.postgresql.org Subject: Re: Attribute of type record has wrong type error with MERGE ... WHEN NOT MATCHED BY SOURCE THEN DELETE In-reply-to: References: <3518c50a-ab18-482f-b916-a37263622501@deepbluecap.com> <971078.1741629162@sss.pgh.pa.us> <1207317.1741633880@sss.pgh.pa.us> Comments: In-reply-to Dean Rasheed message dated "Mon, 10 Mar 2025 20:03:15 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1214516.1741638020.1@sss.pgh.pa.us> Date: Mon, 10 Mar 2025 16:20:20 -0400 Message-ID: <1214517.1741638020@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Dean Rasheed writes: > I tried looking for other places that change an RTE's rtekind, and > haven't managed to find any other problems, but may have missed > something. The only other place I can find that converts some other kind of RTE to a subquery is inline_cte(), which converts RTE_CTE to RTE_SUBQUERY. That seems immune to the present problem because the appropriate vartype would be RECORD in either case. regards, tom lane