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

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: "David E(dot) Wheeler" <david(at)justatheory(dot)com>
Cc: Florents Tselai <florents(dot)tselai(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>, Álvaro Herrera <alvherre(at)kurilemu(dot)de>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Peter Eisentraut <peter(at)eisentraut(dot)org>, Robert Haas <robertmhaas(at)gmail(dot)com>, Alexander Korotkov <aekorotkov(at)gmail(dot)com>, jian he <jian(dot)universality(at)gmail(dot)com>
Subject: Re: PATCH: jsonpath string methods: lower, upper, initcap, l/r/btrim, replace, split_part
Date: 2026-03-28 15:02:13
Message-ID: b3c965ea-89c1-4ef1-a2a9-29854345f96d@dunslane.net
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 2026-03-28 Sa 10:30 AM, David E. Wheeler wrote:
> On Mar 28, 2026, at 06:04, Andrew Dunstan <andrew(at)dunslane(dot)net> wrote:
>
>> I have fixed that. Some key_name entries were missing, which was an issue. I also removed some unused variables and some duplicate tests, and did some general tidying.
> Looks good to me! I’m curious what the implication of missing `key_name`s was, since the tests passed and all the functions worked. Can we create additional tests that would fail when the keys were missing?

The key_name production is what allows a keyword to also be used as an
object key in $.keyname syntax. The trim keywords (ltrim, rtrim, btrim)
were added there, so $.ltrim as a key works. But $.lower,
$.upper, $.initcap, $.replace, and $.split_part as keys would all break.

There are tests added for it.

cheers

andrew

--
Andrew Dunstan
EDB: https://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Roberto Mello 2026-03-28 15:11:17 PROPOSAL for when publication row filter columns are not in replica identity (BUG #19434)
Previous Message Henson Choi 2026-03-28 14:43:09 Re: SQL Property Graph Queries (SQL/PGQ)