Add additional jsonpath string methods

Add the following jsonpath methods:

*   l/r/btrim()
*   lower(), upper()
*   initcap()
*   replace()
*   split_part()

Each simply dispatches to the standard string processing functions.
These depend on the locale, but since it's set at `initdb`, they can be
considered immutable and therefore allowed in any jsonpath expression.

Author: Florents Tselai <[email protected]>
Co-authored-by: David E. Wheeler <[email protected]>
Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Andrew Dunstan <[email protected]>
Discussion: 
https://postgr.es/m/CA+v5N40sJF39m0v7h=qn86zgp0cuf9f1wkasnzy9nnvj_vh...@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/bd4f879a9cdd11b6b683cea0ea51d7c27a8f1153

Modified Files
--------------
doc/src/sgml/func/func-json.sgml                 | 140 +++++++++
src/backend/utils/adt/jsonpath.c                 | 117 ++++++-
src/backend/utils/adt/jsonpath_exec.c            | 178 +++++++++++
src/backend/utils/adt/jsonpath_gram.y            |  33 +-
src/backend/utils/adt/jsonpath_scan.l            |   8 +
src/include/utils/jsonpath.h                     |   8 +
src/test/regress/expected/jsonb_jsonpath.out     | 381 +++++++++++++++++++++++
src/test/regress/expected/jsonpath.out           | 186 +++++++++++
src/test/regress/expected/sqljson_queryfuncs.out |  10 +-
src/test/regress/sql/jsonb_jsonpath.sql          | 106 +++++++
src/test/regress/sql/jsonpath.sql                |  41 +++
src/test/regress/sql/sqljson_queryfuncs.sql      |  11 +-
12 files changed, 1212 insertions(+), 7 deletions(-)

Reply via email to