Re: Add jsonb_translate(jsonb, from, to) - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: Add jsonb_translate(jsonb, from, to)
Date
Msg-id ea9fa483-db55-48c8-a566-8a6d83690f78@dunslane.net
Whole thread Raw
In response to Add jsonb_translate(jsonb, from, to)  (Florents Tselai <florents.tselai@gmail.com>)
List pgsql-hackers
On 2025-09-27 Sa 1:16 PM, Florents Tselai wrote:
> This is a spur of the moment patch really,
> but while going through the process of translating some json data from 
> Greek to English I found myself wishing for $subject.
> Inspired by the Unix tr utility.
>
> Here's a working v1
>
> If others find it useful as well,
> I'd go ahead with a json implementation
> And an additional parameter to make in-arrays replacement optional.



It's not clear to me that this is a good idea. Blindly replacing every 
instance of a single string regardless of context seems at best a niche 
use. Is there any reason not to make this an extension?

I haven't dug deeply into the patch, but I don't understand why you're 
putting an entry for this in system_functions.sql.


cheers


andrew

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




pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: split func.sgml to separated individual sgml files
Next
From: Masahiko Sawada
Date:
Subject: Re: POC: enable logical decoding when wal_level = 'replica' without a server restart