Re: SQL JSON path enhanced numeric literals

From: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
To: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
Cc: Vik Fearing <vik(at)postgresfriends(dot)org>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: SQL JSON path enhanced numeric literals
Date: 2023-03-03 20:16:15
Message-ID: CAEZATCXFHuYD_zk+ssoLBEADHLM79=gckzCzt0__TuZYzuonqA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, 28 Feb 2023 at 07:44, Peter Eisentraut
<peter(dot)eisentraut(at)enterprisedb(dot)com> wrote:
>
> Attached is a patch to add nondecimal integer literals and underscores
> in numeric literals to the SQL JSON path language. This matches the
> recent additions to the core SQL syntax. It follows ECMAScript in
> combination with the current SQL draft.
>

I think this new feature ought to be mentioned in the docs somewhere.
Perhaps a sentence or two in the note below table 9.49 would suffice,
since it looks like that's where jsonpath numbers are mentioned for
the first time.

In jsonpath_scan.l, I think the hex/oct/bininteger cases could do with
a comment, such as

/* Non-decimal integers in ECMAScript; must not have underscore after radix */
hexinteger 0[xX]{hexdigit}(_?{hexdigit})*
octinteger 0[oO]{octdigit}(_?{octdigit})*
bininteger 0[bB]{bindigit}(_?{bindigit})*

since that's different from the main lexer's syntax.

Perhaps it's worth mentioning that difference in the docs.

Otherwise, this looks good to me.

Regards,
Dean

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dmitry Dolgov 2023-03-03 20:17:57 Re: Schema variables - new implementation for Postgres 15
Previous Message Tom Lane 2023-03-03 20:09:18 Re: Evaluate arguments of correlated SubPlans in the referencing ExprState