Re: JSON path decimal literal syntax

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: JSON path decimal literal syntax
Дата
Msg-id eb5330c4-beee-0c7f-5ba1-2bab099c6e11@enterprisedb.com
обсуждение исходный текст
Ответ на JSON path decimal literal syntax  (Peter Eisentraut <peter.eisentraut@enterprisedb.com>)
Ответы Re: JSON path decimal literal syntax  (Nikita Glukhov <n.gluhov@postgrespro.ru>)
Список pgsql-hackers
On 18.02.22 11:17, Peter Eisentraut wrote:
> I noticed that the JSON path lexer does not support the decimal literal 
> syntax forms
> 
> .1
> 1.
> 
> (that is, there are no digits before or after the decimal point).  This 
> is allowed by the relevant ECMAScript standard 
> (https://262.ecma-international.org/5.1/#sec-7.8.3) and of course SQL 
> allows it as well.
> 
> Is there a reason for this?  I didn't find any code comments or 
> documentation about this.

It has come to my attention that there are syntactic differences between 
JavaScript, which is what JSON path is built on, and JSON itself. 
Presumably, the JSON path lexer was originally built with the JSON 
syntax in mind.

Attached is an updated patch that implements the JavaScript-based JSON 
path numeric literal syntax more correctly.  Besides the above mentioned 
syntax forms, it now also rejects trailing junk after numeric literals 
more correctly, similar to how the main SQL lexer does it.
Вложения

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: fix crash with Python 3.11
Следующее
От: Nitin Jadhav
Дата:
Сообщение: Re: Report checkpoint progress with pg_stat_progress_checkpoint (was: Report checkpoint progress in server logs)