Re: The jsonpath predicate `like_regex` does not accept variables for pattern (or flags)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: sulfinu(at)gmail(dot)com
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: The jsonpath predicate `like_regex` does not accept variables for pattern (or flags)
Date: 2024-08-06 17:50:29
Message-ID: 1799749.1722966629@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

sulfinu(at)gmail(dot)com writes:
> I would like to be able to use a variable inside the like_regex predicate,
> 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%2B9wyiDm3eP%2BG10J09%2B0VRmXBQAdw%40mail.gmail.com

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Robert Haas 2024-08-06 18:48:06 Re: BUG #18545: \dt breaks transaction, calling error when executed in SET SESSION AUTHORIZATION
Previous Message David G. Johnston 2024-08-06 17:48:56 Re: The jsonpath predicate `like_regex` does not accept variables for pattern (or flags)