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 7D19A273-1306-4F4C-9DFD-CE16F44790CB@justatheory.com
Whole thread Raw
In response to Re: PATCH: jsonpath string methods: lower, upper, initcap, l/r/btrim, replace, split_part  ("David E. Wheeler" <david@justatheory.com>)
Responses Re: PATCH: jsonpath string methods: lower, upper, initcap, l/r/btrim, replace, split_part
List pgsql-hackers
On Jul 10, 2025, at 19:23, David E. Wheeler <david@justatheory.com> wrote:

> Now with the `ISO C90 forbids mixed declarations and code` warning cleared up.
>
> Weird that there’s a failure on Bookworm with Meson [1] (pg_regress diffs [2]) but not Bookworm with Configure [3].
Collationissue, perhaps? 

David Johnson noticed that this build is 32-bit. I looked at the split_path function and after trying a couple of
things,realized that it was passing an int8 when the SQL function in Marlena.c passes an int4. This change got the test
passingin my clone (indentation reduced): 


```patch
--- a/src/backend/utils/adt/jsonpath_exec.c
+++ b/src/backend/utils/adt/jsonpath_exec.c
@@ -2959,7 +2959,7 @@ executeStringInternalMethod(JsonPathExecContext *cxt, JsonPathItem *jsp,
     C_COLLATION_OID,
     CStringGetTextDatum(tmp),
     CStringGetTextDatum(from_str),
-    DirectFunctionCall1(numeric_int8, NumericGetDatum(n))));
+    DirectFunctionCall1(numeric_int4, NumericGetDatum(n))));
                 break;
             }
         default:
```

v12 attached.


Best,

David




Attachment

pgsql-hackers by date:

Previous
From: "DINESH NAIR"
Date:
Subject: Re: [Question] Window Function Results without ORDER BY Clause
Next
From: Nathan Bossart
Date:
Subject: Re: [PATCH] Let's get rid of the freelist and the buffer_strategy_lock