Re: Add jsonb_translate(jsonb, from, to)

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Florents Tselai <florents(dot)tselai(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Add jsonb_translate(jsonb, from, to)
Date: 2025-09-30 20:42:35
Message-ID: ea9fa483-db55-48c8-a566-8a6d83690f78@dunslane.net
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2025-09-30 21:40:26 Re: POC: enable logical decoding when wal_level = 'replica' without a server restart
Previous Message Tom Lane 2025-09-30 20:15:32 Re: split func.sgml to separated individual sgml files