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 1puvcC-0000s2-HS for pgsql-hackers@arkaria.postgresql.org; Fri, 05 May 2023 13:36:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1puvcB-0001Bu-DL for pgsql-hackers@arkaria.postgresql.org; Fri, 05 May 2023 13:36:51 +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 1puvcB-0001Bl-4W for pgsql-hackers@lists.postgresql.org; Fri, 05 May 2023 13:36:51 +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 1puvc3-000k2G-Li for pgsql-hackers@lists.postgresql.org; Fri, 05 May 2023 13:36:50 +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 345DafDR3579738 for ; Fri, 5 May 2023 09:36:41 -0400 From: Tom Lane To: pgsql-hackers@lists.postgresql.org Subject: MERGE lacks ruleutils.c decompiling support!? MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3579736.1683293801.1@sss.pgh.pa.us> Date: Fri, 05 May 2023 09:36:41 -0400 Message-ID: <3579737.1683293801@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk I made this function: CREATE OR REPLACE FUNCTION test_fun() RETURNS void LANGUAGE SQL BEGIN ATOMIC MERGE INTO target USING source s on s.id = target.id WHEN MATCHED THEN UPDATE SET data = s.data WHEN NOT MATCHED THEN INSERT VALUES (s.id, s.data); end; It appears to work fine, but: regression=# \sf+ test_fun() ERROR: unrecognized query command type: 5 and it also breaks pg_dump. Somebody screwed up pretty badly here. Is there any hope of fixing it for Monday's releases? (I'd guess that decompiling the WHEN clause would take a nontrivial amount of new code, so maybe fixing it on such short notice is impractical. But ugh.) regards, tom lane