Re: PATCH: jsonpath string methods: lower, upper, initcap, l/r/btrim, replace, split_part - Mailing list pgsql-hackers

From Marcos Pegoraro
Subject Re: PATCH: jsonpath string methods: lower, upper, initcap, l/r/btrim, replace, split_part
Date
Msg-id CAB-JLwbJEhkdB53yZmn8YxrCHVqWKV7ddr_7vb6ytPA3vKcKxg@mail.gmail.com
Whole thread Raw
In response to Re: PATCH: jsonpath string methods: lower, upper, initcap, l/r/btrim, replace, split_part  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-hackers
Em sex., 3 de abr. de 2026 às 10:36, Andrew Dunstan <andrew@dunslane.net> escreveu:

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

Regression has this, so you are correct.
select jsonb_path_query('"zzzytest"', '$.ltrim("xyz")');
 jsonb_path_query
------------------
 "test"

I always thought that only those with exactly the same string would be removed, but thinking char by char, then it makes perfect sense.
And it works like string trim functions, so everything's fine. 
Sorry for the noise.

regards
Marcos

pgsql-hackers by date:

Previous
From: Imran Zaheer
Date:
Subject: Re: Silence -Wmaybe-uninitialized warnings
Next
From: Thomas Munro
Date:
Subject: Re: pg_waldump: support decoding of WAL inside tarfile