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.