Re: PATCH: jsonpath string methods: lower, upper, initcap, l/r/btrim, replace, split_part

jian he <jian.universality@gmail.com>

From: jian he <jian.universality@gmail.com>
To: "David E. Wheeler" <david@justatheory.com>
Cc: Chao Li <li.evan.chao@gmail.com>, Álvaro Herrera <alvherre@kurilemu.de>, Florents Tselai <florents.tselai@gmail.com>, Tom Lane <tgl@sss.pgh.pa.us>, Peter Eisentraut <peter@eisentraut.org>, Robert Haas <robertmhaas@gmail.com>, Alexander Korotkov <aekorotkov@gmail.com>, pgsql-hackers <pgsql-hackers@lists.postgresql.org>, Andrew Dunstan <andrew@dunslane.net>
Date: 2025-12-04T04:22:19Z
Lists: pgsql-hackers
On Thu, Dec 4, 2025 at 11:56 AM jian he <jian.universality@gmail.com> wrote:
>
> On Mon, Dec 1, 2025 at 5:16 AM David E. Wheeler <david@justatheory.com> wrote:
> >
> > Well-spotted, thank you! Fixed in v15, attached.
> >
>
> seems no deparse regress tests, like:
> create view vj as select jsonb_path_query('"   hello   "', '$.ltrim(" ")') as a;
> \sv vj
>
> that mean the changes in printJsonPathItem are not tested?
>

hi.
seems no tests for the changes in jspIsMutableWalker too.
we can make some simple dummy tests like:

create table tjs(a jsonb);
create index on tjs(jsonb_path_match(a, '$.ltrim(" ")'));

--
jian
https://www.enterprisedb.com/



Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Add additional jsonpath string methods

  2. Rename jsonpath method arg tokens

  3. Fix transient memory leakage in jsonpath evaluation.

  4. Make jsonpath .string() be immutable for datetimes.