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 1sbOKR-00GHYJ-Qa for pgsql-bugs@arkaria.postgresql.org; Tue, 06 Aug 2024 17:50:35 +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 1sbOKQ-001n8l-6W for pgsql-bugs@arkaria.postgresql.org; Tue, 06 Aug 2024 17:50:34 +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 1sbOKP-001n8d-UM for pgsql-bugs@lists.postgresql.org; Tue, 06 Aug 2024 17:50:33 +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 1sbOKN-003PoX-8o for pgsql-bugs@lists.postgresql.org; Tue, 06 Aug 2024 17:50:32 +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 476HoTQ61799750; Tue, 6 Aug 2024 13:50:29 -0400 From: Tom Lane To: sulfinu@gmail.com cc: pgsql-bugs@lists.postgresql.org Subject: Re: The jsonpath predicate `like_regex` does not accept variables for pattern (or flags) In-reply-to: References: Comments: In-reply-to sulfinu@gmail.com message dated "Tue, 06 Aug 2024 19:42:09 +0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1799748.1722966629.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 06 Aug 2024 13:50:29 -0400 Message-ID: <1799749.1722966629@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk sulfinu@gmail.com writes: > I would like to be able to use a variable inside the like_regex predicat= e, > at least for the pattern. This was discussed before [1]. The restriction to a constant pattern is per SQL spec. It's not entirely clear to us why the spec is written that way, but there may be some actual semantic point behind it. In any case, if you want to propose a patch, that thread would probably be the best place to do it. regards, tom lane [1] https://www.postgresql.org/message-id/flat/CAGHENJ4A8awD2uXHkf50eV%2B9= wyiDm3eP%2BG10J09%2B0VRmXBQAdw%40mail.gmail.com