Re: [PATCH] WIP: replace method for jsonpath - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: [PATCH] WIP: replace method for jsonpath
Date
Msg-id f9b2da4e-a252-4d47-b6ff-98d777cce6fa@eisentraut.org
Whole thread Raw
In response to Re: [PATCH] WIP: replace method for jsonpath  ("David E. Wheeler" <david@justatheory.com>)
Responses Re: [PATCH] WIP: replace method for jsonpath
Re: [PATCH] WIP: replace method for jsonpath
List pgsql-hackers
On 17.09.24 21:16, David E. Wheeler wrote:
> On Sep 17, 2024, at 15:03, Florents Tselai <florents.tselai@gmail.com> wrote:
> 
>> Fallback scenario: make this an extension, but in a first pass I didn’t find any convenient hooks.
>> One has to create a whole new scanner, grammar etc.
> 
> Yeah, it got me thinking about the RFC-9535 JSONPath "Function Extension" feature[1], which allows users to add
functions.Would be cool to have a way to register jsonpath functions somehow, but I would imagine it’d need quite a bit
ofspecification similar to RFC-9535. Wouldn’t surprise me to see something like that appear in a future version of the
spec,with an interface something like CREATE OPERATOR.
 

Why can't we "just" call any suitable pg_proc-registered function from 
JSON path?  The proposed patch routes the example 
'$.replace("hello","bye")' internally to the internal implementation of 
the SQL function replace(..., 'hello', 'bye').  Why can't we do this 
automatically for any function call in a JSON path expression?




pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: information_schema.view attgenerated
Next
From: Florents Tselai
Date:
Subject: Re: [PATCH] WIP: replace method for jsonpath