Re: JSON path decimal literal syntax - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: JSON path decimal literal syntax
Date
Msg-id 9a5fc38c-6a2f-e4d6-a917-fc3cd40dbeed@enterprisedb.com
Whole thread Raw
In response to Re: JSON path decimal literal syntax  (Nikita Glukhov <n.gluhov@postgrespro.ru>)
List 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

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Granting SET and ALTER SYSTE privileges for GUCs
Next
From: Mark Dilger
Date:
Subject: Re: Granting SET and ALTER SYSTE privileges for GUCs