Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qtYGs-00Crjm-TY for pgsql-bugs@arkaria.postgresql.org; Thu, 19 Oct 2023 19:01:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qtYGq-0061bG-4N for pgsql-bugs@arkaria.postgresql.org; Thu, 19 Oct 2023 19:01:24 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qtYGp-0061ax-Rg for pgsql-bugs@lists.postgresql.org; Thu, 19 Oct 2023 19:01:24 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qtYGn-001Ip7-Qf for pgsql-bugs@lists.postgresql.org; Thu, 19 Oct 2023 19:01:23 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 39JJ1Jkw3378579; Thu, 19 Oct 2023 15:01:19 -0400 From: Tom Lane To: "David G. Johnston" cc: Jeff Janes , Erwin Brandstetter , PostgreSQL Bug List Subject: Re: Variable substitution in jsonb functions fails for jsonpath operator like_regex In-reply-to: References: <3157573.1697663770@sss.pgh.pa.us> <3241895.1697679989@sss.pgh.pa.us> Comments: In-reply-to "David G. Johnston" message dated "Wed, 18 Oct 2023 19:13:16 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3378577.1697742079.1@sss.pgh.pa.us> Date: Thu, 19 Oct 2023 15:01:19 -0400 Message-ID: <3378578.1697742079@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk "David G. Johnston" writes: > On Wed, Oct 18, 2023, 18:47 Tom Lane wrote: >> 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. Hmm ... looks like we *are* following the standard: ::= like_regex [ flag ] ::= ::= whereas "starts with" has ::= starts with ::= ::= The text mentions that "the second operand is permitted to be an SQL/JSON sequence and to support existential semantics", whereas they evidently don't want that for a regex pattern. regards, tom lane