v.22.6New Feature

Support non-constant pattern argument for LIKE, ILIKE, and match functions

Support non-constant pattern argument for LIKE, ILIKE and match functions. #37251 (Robert Schulze).
Support for using non-constant pattern arguments in LIKE, ILIKE, and match functions.

Why it matters

Previously, the pattern arguments in LIKE, ILIKE, and match functions had to be constant values. This feature enables patterns to be dynamic, allowing users to perform pattern matching with variable expressions or column values, increasing flexibility and expressiveness in queries.

How to use it

Simply use LIKE, ILIKE, or match functions with non-constant expressions or columns as the pattern argument in your queries, for example:
SELECT * FROM table WHERE column LIKE another_column