Re: Variable substitution in jsonb functions fails for jsonpath operator like_regex - Mailing list pgsql-bugs

From David G. Johnston
Subject Re: Variable substitution in jsonb functions fails for jsonpath operator like_regex
Date
Msg-id CAKFQuwaBB+PPZkn0GtTzt5z6Vtypt2CQ-5+nK7XzW6zm9UqaDQ@mail.gmail.com
Whole thread Raw
In response to Re: Variable substitution in jsonb functions fails for jsonpath operator like_regex  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Variable substitution in jsonb functions fails for jsonpath operator like_regex  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
On Wed, Oct 18, 2023, 18:47 Tom Lane <tgl@sss.pgh.pa.us> wrote:
Jeff Janes <jeff.janes@gmail.com> writes:
> On Wed, Oct 18, 2023 at 5:20 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Maybe it wouldn't take more than s/STRING_P/starts_with_initial/
>> here (though I'd then rename starts_with_initial to something
>> more generic).

> I tried it, and it didn't work.  No error, it just doesn't match
> anything--including literal values which do match things in HEAD.

Oh, duh, makeItemLikeRegex() is expecting a plain JsonPathString,
and JsonPathParseItem.value.like_regex is set up for just a
constant pattern.  We could no doubt fix that, but it's a bigger
lift than I was hoping.


Not in a position to do it myself but we should confirm we aren't simply following the standard here, and if so decide whether we want to deviate.

David J.

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: Variable substitution in jsonb functions fails for jsonpath operator like_regex
Next
From: Aleš Zelený
Date:
Subject: Re: Invalid dump file after drop of role that previously created extension containing a table.