Re: Q: Escapes in jsonpath Idents

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: Q: Escapes in jsonpath Idents
Дата
Msg-id 8112fb7a-ebb3-4acc-be6c-32092c25683d@eisentraut.org
обсуждение исходный текст
Ответ на Re: Q: Escapes in jsonpath Idents  (Erik Wienhold <ewie@ewie.name>)
Ответы Re: Q: Escapes in jsonpath Idents  ("David E. Wheeler" <david@justatheory.com>)
Список pgsql-hackers
On 18.03.24 01:09, Erik Wienhold wrote:
>>> The error message 'syntax error at or near "$oo" of jsonpath input' for
>>> the second case ($.f$oo), however, looks as if the scanner identifies
>>> '$oo' as a variable instead of contiuing the scan of identifier (f$oo)
>>> for the member accessor.  Looks like a bug to me because a variable
>>> doesn't even make sense in that place.
>> Right. Maybe the docs should be updated to say that a literal dollar
>> sign isn’t supported in identifiers, unlike in JavaScript, except
>> through escapes like this:
> Unfortunately, I don't have access to that part of the SQL spec.  So I
> don't know how the jsonpath grammar is specified.

The SQL spec says that <JSON path identifier> corresponds to Identifier 
in ECMAScript.

But it also says,

     A <JSON path identifier> is classified as follows.

     Case:

     a) A <JSON path identifier> that is a <dollar sign> is a <JSON path
        context variable>.

     b) A <JSON path identifier> that begins with <dollar sign> is a
        <JSON path named variable>.

     c) Otherwise, a <JSON path identifier> is a <JSON path key name>.

Does this help?  I wasn't following all the discussion to see if there 
is anything wrong with the implementation.




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

Предыдущее
От: Matthias van de Meent
Дата:
Сообщение: Re: Cleanup: remove unused fields from nodes
Следующее
От: Alexander Korotkov
Дата:
Сообщение: Re: [PATCH] Improve amcheck to also check UNIQUE constraint in btree index.