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 1t3HOw-00BcKY-T2 for pgsql-general@arkaria.postgresql.org; Tue, 22 Oct 2024 16:06:31 +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 1t3HOu-001Akk-Oz for pgsql-general@arkaria.postgresql.org; Tue, 22 Oct 2024 16:06:29 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t3HLj-0014um-Cj for pgsql-general@lists.postgresql.org; Tue, 22 Oct 2024 16:03:12 +0000 Received: from fhigh-b5-smtp.messagingengine.com ([202.12.124.156]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t3HLg-002JNW-CZ for pgsql-general@lists.postgresql.org; Tue, 22 Oct 2024 16:03:10 +0000 Received: from phl-compute-04.internal (phl-compute-04.phl.internal [10.202.2.44]) by mailfhigh.stl.internal (Postfix) with ESMTP id D4CA4254010C; Tue, 22 Oct 2024 12:03:06 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-04.internal (MEProxy); Tue, 22 Oct 2024 12:03:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1729612986; x=1729699386; bh=vejeqxdnQPUt/qAHP2kdyyRObmz8LxqxpnbfOlootr8=; b= lcUB4xHftgmHhmRGi7Agzw6zz1dJL07pDZVCw6ldaWRwymFy8Nox0rTXiwkI8Sks gqnguB2cWP6o0SToQ4LG3WoIg+7gm2hasc8X3DqzPXPk4OukB4z46Gij9/rFF6Py sUXrGT6uz2um7mXKzLPDyCIMwp9CHIxxajoPlyfRNjp83Ot0aaU1EdOdaLp6OTR0 dJpHJ8alrIATsIVsFR2ZFRO8X8glL9AODbbnYd+CkKGQktKRZHoX0K18MGk6ctvJ JJTXcAHA6IEOy1X9S9szL7i3PMmTYZEGlfndA0eGZpIFzQ+yERWg0FCKMtS0fn3M t9EX5SW3PxsUr2tCSBw8Ng== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1729612986; x= 1729699386; bh=vejeqxdnQPUt/qAHP2kdyyRObmz8LxqxpnbfOlootr8=; b=Q oPkYzd1jPeMsPa+AVoy0FRDpKSTXysqlTrtNNN65/b7kB2fMXLDGZ/PS9HIK57Ew x+lH+np26XEo8JtC9GKwpJI0V0G2nWmEcs8uv7SU68f6BkGYE3tPpWdstzBx2DeA M/r8nUYQiWpnc4Q+D/6Z4qW/TbdBkLzAgyXF8k/m+giiXJLv/B/Ul9vKExp+q80p XxvXSmqagjyhftY4WlCjjZmAISFxdgSK3y6rm/sUmm7tZ9P6KOVe+yA27pUnjYmM FftXElwFB24rWIcbs8jJ3Wp4j3UM9hKfrO65cQHfPpA9JgHAaYie6Sz8+GJALgFi rQFBU3rbZsAZ4FutVXzmw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvdeihedgleeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhepkfffgggfuffvfhfhjggtgfesthekredttddvjeen ucfhrhhomheptegurhhirghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrse grkhhlrghvvghrrdgtohhmqeenucggtffrrghtthgvrhhnpeelgeevkeekkeeuiefgtdev ieeluefhfedufeetkeejffekjeeujeehgeehgeektdenucffohhmrghinhepphhoshhtgh hrvghsqhhlrdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghi lhhfrhhomheprggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomhdpnhgspg hrtghpthhtohepvddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtoheptgholhhinhht hhgrrhhtsehgmhgrihhlrdgtohhmpdhrtghpthhtohepphhgshhqlhdqghgvnhgvrhgrlh eslhhishhtshdrphhoshhtghhrvghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 22 Oct 2024 12:03:06 -0400 (EDT) Message-ID: <6eded364-8072-4ca4-9ba7-1003a120c2b8@aklaver.com> Date: Tue, 22 Oct 2024 09:03:05 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Regression in Postgres 17? To: Colin 't Hart , pgsql-general@lists.postgresql.org References: Content-Language: en-US From: Adrian Klaver In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 10/22/24 08:54, Colin 't Hart wrote: > Hi, > > This works in Postgres 15: > > pg15> create function json_test(out value text, out json jsonb) > returns record > language sql > as > $$ >   select null::text, null::jsonb; > $$ > ; > CREATE FUNCTION > pg15> select * from json_test(); > ┌───────┬──────┐ > │ value │ json │ > ├───────┼──────┤ > │       │      │ > └───────┴──────┘ > (1 row) > > > In Postgres 17 trying to create the function yields an error: > > pg17> create function json_test(out value text, out json jsonb) > returns record > language sql > as > $$ >   select null::text, null::jsonb; > $$ > ; > 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. Guessing you got caught by this: https://www.postgresql.org/docs/16/sql-keywords-appendix.html JSON non-reserved reserved https://www.postgresql.org/docs/17/sql-keywords-appendix.html JSON non-reserved (cannot be function or type) reserved > Thanks, > > Colin -- Adrian Klaver adrian.klaver@aklaver.com