Re: Fix parsing of identifiers in jsonpath

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Nikita Glukhov <n(dot)gluhov(at)postgrespro(dot)ru>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Alexander Korotkov <a(dot)korotkov(at)postgrespro(dot)ru>
Subject: Re: Fix parsing of identifiers in jsonpath
Date: 2019-09-18 21:28:16
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Nikita Glukhov <n(dot)gluhov(at)postgrespro(dot)ru> writes:
> I don't know if it is possible to check Unicode properties "ID_Start" and
> "ID_Continue" in Postgres, and what ZWNJ/ZWJ is. Now, identifier's starting
> character set is simply determined by the exclusion of all recognized special
> characters.

TBH, I think you should simply ignore any aspect of any of these standards
that is defined by reference to Unicode. We are not necessarily dealing
with a Unicode character set, so at best, references to things like ZWNJ
are unreachable no-ops in a lot of environments.

As a relevant example, modern SQL defines whitespace in terms of Unicode[1],
a fact that we have ignored from the start and will likely continue to
do so.

You could do a lot worse than to just consider identifiers to be the same
strings as our SQL lexer would do (modulo things like "$" that have
special status in the path language).

regards, tom lane

[1] cf 4.2.4 "Character repertoires" in SQL:2011

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Melanie Plageman 2019-09-18 21:32:13 Re: Memory Accounting
Previous Message Tom Lane 2019-09-18 21:12:20 Re: Define jsonpath functions as stable