Re: Add jsonb_translate(jsonb, from, to)

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: Florents Tselai <florents(dot)tselai(at)gmail(dot)com>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Add jsonb_translate(jsonb, from, to)
Date: 2025-10-01 11:55:55
Message-ID: 8d3c7094-4b22-4c6c-a9e7-3f0b55f5ec04@eisentraut.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 29.09.25 14:34, Florents Tselai wrote:
>> Cannot be better to use JsonPath for specification what should be
>> replaced?
>
> Fair point.
> The main purpose of this patch is to provide a recursive, global
> replacement across all values and arrays,
> which is not as straightforward to express in JSONPath today.
> I understand that some may find this too case-specific, so I’m just
> leaving it out there for consideration.
> That said, I believe it can be quite useful in domains where documents
> carry many tags or labels that need to be translated or normalized
> consistently.

Oracle has a json_transform function, which has also been added to the
SQL standard draft recently. That appears to be more in the direction
that Pavel is suggesting. Maybe someone wants to take a stab at it.
(In that case, having both a json_transform and a json_translate might
be confusing.)

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Burd 2025-10-01 11:56:07 Re: [PATCH] Add tests for Bitmapset
Previous Message Aleksander Alekseev 2025-10-01 11:45:59 Re: The ability of postgres to determine loss of files of the main fork