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 1t3HV8-00BcnH-Mn for pgsql-general@arkaria.postgresql.org; Tue, 22 Oct 2024 16:12:54 +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 1t3HV7-001ETj-2L for pgsql-general@arkaria.postgresql.org; Tue, 22 Oct 2024 16:12:53 +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 1t3HV6-001ETb-Nz for pgsql-general@lists.postgresql.org; Tue, 22 Oct 2024 16:12:53 +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 1t3HV4-002Pxc-Lc for pgsql-general@lists.postgresql.org; Tue, 22 Oct 2024 16:12:52 +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 49MGCkCp1971275; Tue, 22 Oct 2024 12:12:46 -0400 From: Tom Lane To: Adrian Klaver cc: "Colin 't Hart" , pgsql-general@lists.postgresql.org Subject: Re: Regression in Postgres 17? In-reply-to: <6eded364-8072-4ca4-9ba7-1003a120c2b8@aklaver.com> References: <6eded364-8072-4ca4-9ba7-1003a120c2b8@aklaver.com> Comments: In-reply-to Adrian Klaver message dated "Tue, 22 Oct 2024 09:03:05 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <1971273.1729613566.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Tue, 22 Oct 2024 12:12:46 -0400 Message-ID: <1971274.1729613566@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Adrian Klaver writes: >> In Postgres 17 trying to create the function yields an error: >> >> pg17> create function json_test(out value text, out json jsonb) >> returns record >> ... >> ERROR:  syntax error at or near "jsonb" >> LINE 1: create function json_test(out value text, out json jsonb) >> >> Am I doing something wrong? Or is this a regression? > Yes you are doing something wrong, naming an argument with a type > name(json) is not a good idea. The actual problem is that the SQL standards committee invented some bizarre syntax that we couldn't parse without making JSON a partially-reserved word. It still works as a type name, but in this particular syntax where it's not initially clear which names are type names, you lose. Double-quote the argument name, or name it something other than "json". regards, tom lane