Re: PATCH: jsonpath string methods: lower, upper, initcap, l/r/btrim, replace, split_part

David E. Wheeler <david@justatheory.com>

From: "David E. Wheeler" <david@justatheory.com>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Florents Tselai <florents.tselai@gmail.com>, Alexander Korotkov <aekorotkov@gmail.com>, Tom Lane <tgl@sss.pgh.pa.us>, pgsql-hackers <pgsql-hackers@lists.postgresql.org>, Andrew Dunstan <andrew@dunslane.net>, Peter Eisentraut <peter@eisentraut.org>
Date: 2025-05-13T18:07:10Z
Lists: pgsql-hackers
On May 9, 2025, at 15:50, Robert Haas <robertmhaas@gmail.com> wrote:

> # 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.
> 
> But I'm not sure I understand why it matters that there are multiple
> sources of mutability here. Maybe I'm missing a piece of the puzzle
> here.

I read that to mean “we’re not going to add another json_path_exists_* function for every potentially immutable JSONPath function. But I take your point that it could be generalized for *any* mutable function. In which case maybe it should be renamed?

Best,

David

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Add additional jsonpath string methods

  2. Rename jsonpath method arg tokens

  3. Fix transient memory leakage in jsonpath evaluation.

  4. Make jsonpath .string() be immutable for datetimes.