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

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Marcos Pegoraro <marcos(at)f10(dot)com(dot)br>
Cc: "David E(dot) Wheeler" <david(at)justatheory(dot)com>, 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-04-03 13:36:31
Message-ID: df89cceb-d48a-49ee-b54c-d1b1c648b4c5@dunslane.net
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 2026-04-03 Fr 7:51 AM, Andrew Dunstan wrote:
>
>
> On 2026-04-02 Th 5:10 PM, Marcos Pegoraro wrote:
>> Em qui., 2 de abr. de 2026 às 16:22, Andrew Dunstan
>> <andrew(at)dunslane(dot)net> escreveu:
>>
>> Committed.
>>
>> There is a typo here.
>> <literal>jsonb_path_query('"xyxtrimyyx"', '$.btrim("xyz")')</literal>
>> should be
>> <literal>jsonb_path_query('"xyztrimxyz"', '$.btrim("xyz")')</literal>
>>
>>
>
> Good catch, will fix.
>
>
>

On second thoughts, I don't think this is a typo. btrim() removes
leading and trailing sequences of any characters in the argument string.:

andrew(at)~=# select jsonb_path_query('"xyxtrimyyx"', '$.btrim("xyz")');
 jsonb_path_query
------------------
 "trim"
(1 row)

cheers

andrew

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniil Davydov 2026-04-03 13:45:39 Re: POC: Parallel processing of indexes in autovacuum
Previous Message Chao Li 2026-04-03 13:28:03 Re: Small and unlikely overflow hazard in bms_next_member()