public inbox for [email protected]
help / color / mirror / Atom feedFrom: Tom Lane <[email protected]>
To: Adrian Klaver <[email protected]>
Cc: Colin 't Hart <[email protected]>
Cc: [email protected]
Subject: Re: Regression in Postgres 17?
Date: Tue, 22 Oct 2024 12:12:46 -0400
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <CAMon-aR07TWHZt2QX9QsZQEniyE-6+FdHJSGwyMwvegJSjjNug@mail.gmail.com>
<[email protected]>
Adrian Klaver <[email protected]> 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
view thread (2+ messages)
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected]
Subject: Re: Regression in Postgres 17?
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox