Re: JSON path decimal literal syntax

From: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
To: Nikita Glukhov <n(dot)gluhov(at)postgrespro(dot)ru>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: JSON path decimal literal syntax
Date: 2022-03-16 18:48:51
Message-ID: 9a5fc38c-6a2f-e4d6-a917-fc3cd40dbeed@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 06.03.22 02:43, Nikita Glukhov wrote:
> Obviously, there are compatibility issues with expressions like
> '1.type()', which will start to require parentheses around numbers,
> but they seem to be useful only for our regression tests.
>
> The corresponding changes in jsonpath_out() related to parentheses
> are missing in the v2 patch:
>
> =# select '(1).a'::jsonpath;
> jsonpath
> ----------
> 1."a"
> (1 row)
>
> =# select '(1).a'::jsonpath::text::jsonpath;
> ERROR: syntax error, unexpected STRING_P, expecting $end at or near """ of jsonpath input
>
>
> I have added in v3 enclosing of numbers in parentheses if they have
> successive path items. (Changed results of several test cases, one test
> case added.)

Thank you for these insights. I have integrated this into my patch and
updated the commit message to point out the change.

Attachment Content-Type Size
v4-0001-Make-JSON-path-numeric-literals-more-correct.patch text/plain 12.6 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Mark Dilger 2022-03-16 18:59:06 Re: Granting SET and ALTER SYSTE privileges for GUCs
Previous Message Tom Lane 2022-03-16 18:47:24 Re: Granting SET and ALTER SYSTE privileges for GUCs