Re: JSON/SQL: jsonpath: incomprehensible error message
Amit Kapila <amit.kapila16@gmail.com>
From: Amit Kapila <amit.kapila16@gmail.com>
To: Erik Rijkers <er@xs4all.nl>
Cc: Andrew Dunstan <andrew@dunslane.net>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2022-06-30T08:19:53Z
Lists: pgsql-hackers
On Wed, Jun 29, 2022 at 6:58 PM Erik Rijkers <er@xs4all.nl> wrote:
>
> Op 29-06-2022 om 15:00 schreef Amit Kapila:
> > On Mon, Jun 27, 2022 at 8:46 PM Andrew Dunstan <andrew@dunslane.net> wrote:
> >>
> >> On 2022-06-26 Su 11:44, Erik Rijkers wrote:
> >>> JSON/SQL jsonpath
> >>>
> >>> For example, a jsonpath string with deliberate typo 'like_regexp'
> >>> (instead of 'like_regex'):
> >>>
> >>> select js
> >>> from (values (jsonb '{}')) as f(js)
> >>> where js @? '$ ? (@ like_regexp "^xxx")';
> >>>
> >>> ERROR: syntax error, unexpected IDENT_P at or near " " of jsonpath input
> >>> LINE 1: ...s from (values (jsonb '{}')) as f(js) where js @? '$ ? (@
> >>> li...
> >>>
> >>> Both 'IDENT_P' and 'at or near " "' seem pretty useless.
> >>>
>
> > removing this. One thing that is not clear to me is why OP sees an
> > acceptable message (ERROR: syntax error, unexpected invalid token at
> > or near "=" of jsonpath input) for a similar query in 14?
>
> To mention that was perhaps unwise of me because The IDENT_P (or more
> generally, *_P) messages can be provoked on 14 too.
>
Okay, then I think it is better to backpatch this fix.
--
With Regards,
Amit Kapila.
Commits
-
Remove %error-verbose directive from jsonpath parser
- 7d9bf589ba84 15.0 landed
- 2cf875a4b58d 12.12 landed
- 03cefe81484d 13.8 landed
- 7fd43684fc9e 14.5 landed
- 89a39d4a4da0 16.0 landed
-
Partial implementation of SQL/JSON path language
- 72b6460336e8 12.0 cited