Re: Regression in Postgres 17?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
Cc: "Colin 't Hart" <colinthart(at)gmail(dot)com>, pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Regression in Postgres 17?
Date: 2024-10-22 16:12:46
Message-ID: 1971274.1729613566@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com> 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Dominique Devienne 2024-10-22 16:16:12 Re: Regression in Postgres 17?
Previous Message Adrian Klaver 2024-10-22 16:03:05 Re: Regression in Postgres 17?