postgresql/src/backend
Peter Eisentraut e26114c817 Make JSON path numeric literals more correct
Per ECMAScript standard (ECMA-262, referenced by SQL standard), the
syntax forms

.1
1.

should be allowed for decimal numeric literals, but the existing
implementation rejected them.

Also, by the same standard, reject trailing junk after numeric
literals.

Note that the ECMAScript standard for numeric literals is in respects
like these slightly different from the JSON standard, which might be
the original cause for this discrepancy.

A change is that this kind of syntax is now rejected:

    1.type()

This needs to be written as

    (1).type()

This is correct; normal JavaScript also does not accept this syntax.

We also need to fix up the jsonpath output function for this case.  We
put parentheses around numeric items if they are followed by another
path item.

Reviewed-by: Nikita Glukhov <n.gluhov@postgrespro.ru>
Discussion: https://www.postgresql.org/message-id/flat/50a828cc-0a00-7791-7883-2ed06dfb2dbb@enterprisedb.com
2022-03-28 11:11:39 +02:00
..
access Fix replay of create database records on standby 2022-03-25 13:16:21 +01:00
bootstrap pg_upgrade: Preserve relfilenodes and tablespace OIDs. 2022-01-17 13:40:27 -05:00
catalog Suppress compiler warning in pub_collist_to_bitmapset(). 2022-03-26 11:53:37 -04:00
commands Allow specifying column lists for logical replication 2022-03-26 01:01:27 +01:00
executor SQL/JSON constructors 2022-03-27 17:03:34 -04:00
foreign Create routine able to set single-call SRFs for Materialize mode 2022-03-07 10:26:29 +09:00
jit SQL/JSON constructors 2022-03-27 17:03:34 -04:00
lib dshash: Add sequential scan support. 2022-03-10 12:57:05 -08:00
libpq Refactor code related to pg_hba_file_rules() into new file 2022-03-24 12:42:30 +09:00
main Fix collection of typos in the code and the documentation 2022-03-15 11:29:35 +09:00
nodes SQL/JSON constructors 2022-03-27 17:03:34 -04:00
optimizer SQL/JSON constructors 2022-03-27 17:03:34 -04:00
parser Fix up compiler warnings/errors from f4fb45d15. 2022-03-27 18:32:40 -04:00
partitioning Fix misuse of "const" qualifier. 2022-02-13 19:20:56 -05:00
po Translation updates 2021-06-21 12:33:50 +02:00
port Ensure that the argument of shmdt(2) is declared "void *". 2022-02-15 17:17:28 -05:00
postmaster pgstat: fix function name in comment. 2022-03-22 08:15:40 -07:00
regex Call pg_newlocale_from_collation() also with default collation 2022-01-20 09:50:18 +01:00
replication Don't fail for > 1 walsenders in 019_replslot_limit, add debug messages. 2022-03-27 22:35:42 -07:00
rewrite Add support for security invoker views. 2022-03-22 10:28:10 +00:00
snowball Update copyright for 2022 2022-01-07 19:04:57 -05:00
statistics Fix various typos, grammar and code style in comments and docs 2022-01-25 09:40:04 +09:00
storage Fix typos in standby.c 2022-03-25 14:11:18 +09:00
tcop Add parse_analyze_withcb() 2022-03-09 11:08:16 +01:00
tsearch Update copyright for 2022 2022-01-07 19:04:57 -05:00
utils Make JSON path numeric literals more correct 2022-03-28 11:11:39 +02:00
.gitignore
Makefile Server-side gzip compression. 2022-01-24 15:13:18 -05:00
common.mk Remove PARTIAL_LINKING build mode. 2018-03-30 17:33:04 -07:00
nls.mk Report progress of startup operations that take a long time. 2021-10-25 11:51:57 -04:00