Re: JSON/SQL: jsonpath: incomprehensible error message

Поиск
Список
Период
Сортировка
От Erik Rijkers
Тема Re: JSON/SQL: jsonpath: incomprehensible error message
Дата
Msg-id 520a503e-8c37-d09e-b887-22abed0c0be4@xs4all.nl
обсуждение исходный текст
Ответ на Re: JSON/SQL: jsonpath: incomprehensible error message  (Amit Kapila <amit.kapila16@gmail.com>)
Ответы Re: JSON/SQL: jsonpath: incomprehensible error message
Re: JSON/SQL: jsonpath: incomprehensible error message
Список pgsql-hackers
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. I just thought 
'invalid token' might be a better message because 'token' gives a more 
direct association with 'errors during parsing' which I assume is the 
case here.

IDENT_P or ANY_P convey exactly nothing.


Erik






В списке pgsql-hackers по дате отправления:

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: Emit extra debug message when executing extension script.
Следующее
От: Tom Lane
Дата:
Сообщение: Re: PostgreSQL 15 beta 2 release announcement draft