public inbox for [email protected]  
help / color / mirror / Atom feed
From: Florents Tselai <[email protected]>
To: Alexander Korotkov <[email protected]>
Cc: Tom Lane <[email protected]>
Cc: pgsql-hackers <[email protected]>
Cc: Andrew Dunstan <[email protected]>
Cc: Peter Eisentraut <[email protected]>
Subject: Re: PATCH: jsonpath string methods: lower, upper, initcap, l/r/btrim, replace, split_part
Date: Wed, 5 Mar 2025 21:29:50 +0200
Message-ID: <CA+v5N42PVJH3HbwLE1yC75XR6E5zGnCCdtSUXfgFwtGyPP8XYg@mail.gmail.com> (raw)
In-Reply-To: <CAPpHfdtGhn_5jfLoepOScyqT+FXYB9QtV-OEprychDcMJco7mw@mail.gmail.com>
References: <CA+v5N40sJF39m0v7h=QN86zGp0CUf9F1WKasnZy9nNVj_VhCZQ@mail.gmail.com>
	<[email protected]>
	<CAPpHfdtGhn_5jfLoepOScyqT+FXYB9QtV-OEprychDcMJco7mw@mail.gmail.com>

On Thu, Sep 26, 2024 at 1:55 PM Alexander Korotkov <[email protected]>
wrote:

> On Thu, Sep 26, 2024 at 12:04 AM Tom Lane <[email protected]> wrote:
> > Florents Tselai <[email protected]> writes:
> > > This patch is a follow-up and generalization to [0].
> > > It adds the following jsonpath methods:  lower, upper, initcap,
> l/r/btrim,
> > > replace, split_part.
> >
> > How are you going to deal with the fact that this makes jsonpath
> > operations not guaranteed immutable?  (See commit cb599b9dd
> > for some context.)  Those are all going to have behavior that's
> > dependent on the underlying locale.
> >
> > We have the kluge of having separate "_tz" functions to support
> > non-immutable datetime operations, but that way doesn't seem like
> > it's going to scale well to multiple sources of mutability.
>
> While inventing "_tz" functions I was thinking about jsonpath methods
> and operators defined in standard then.  Now I see huge interest on
> extending that.  I wonder if we can introduce a notion of flexible
> mutability?  Imagine that jsonb_path_query() function (and others) has
> another function which analyzes arguments and reports mutability.  If
> jsonpath argument is constant and all methods inside are safe then
> jsonb_path_query() is immutable otherwise it is stable.  I was
> thinking about that back working on jsonpath, but that time problem
> seemed too limited for this kind of solution.  Now, it's possibly time
> to shake off the dust from this idea.  What do you think?
>

I was thinking about taking another stab at this.
Would someone more versed in the inner workings of jsonpath like to weigh
in on the immutability wrt locale?


view thread (39+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: PATCH: jsonpath string methods: lower, upper, initcap, l/r/btrim, replace, split_part
  In-Reply-To: <CA+v5N42PVJH3HbwLE1yC75XR6E5zGnCCdtSUXfgFwtGyPP8XYg@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox