Re: PATCH: jsonpath string methods: lower, upper, initcap, l/r/btrim, replace, split_part - Mailing list pgsql-hackers

From David E. Wheeler
Subject Re: PATCH: jsonpath string methods: lower, upper, initcap, l/r/btrim, replace, split_part
Date
Msg-id 06FA8975-2E21-46A5-B510-028B3B967EB2@justatheory.com
Whole thread Raw
In response to Re: PATCH: jsonpath string methods: lower, upper, initcap, l/r/btrim, replace, split_part  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Hackers,

On May 26, 2025, at 18:00, David E. Wheeler <david@justatheory.com> wrote:

> Yes, I think it would be best if the grammar was a bit stricter --- and therefore more self-explanatory --- by making
theargs closer to what the functions actually expect. 

I chatted with Florents and went ahead and simplified the grammar and fixed the other issues I identified in my
originalreview. Note that there are two commits, now: 

`v6-0001-Rename-jsonpath-method-arg-tokens.patch` Renames some of the symbols in the jsonpath grammar so that they’re
lessgeneric (`csv*`) and more specific to their contents. This is with the expectation that they will be used by other
methodsin the next patch and in the future. I thought it best to separate this refactoring from the feature patch. 

`v6-0002-Add-additional-jsonpath-string-methods.patch` is that feature patch. The grammar now parses the exact number
andtypes of each method argument, eliminating the need for explicit error checking. It also uses the existing patterns
forhandling methods with two parameters, removing a bunch of duplicate code. 

Overall I think this is ready for committer review, although now that I’m not just reviewing but hacking on this thing,
maybesomeone else should review it first. 

Patches attached, GitHub PR here:

  https://github.com/theory/postgres/pull/12

Best,

David





Attachment

pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: autoprewarm_dump_now
Next
From: Sami Imseih
Date:
Subject: Re: Add log_autovacuum_{vacuum|analyze}_min_duration