v.25.12New Feature
Allow the use of non-constant second arguments for IN operator
Allows the use of non-constant second arguments for IN. It also supports a tuple as a second argument. #77906 (Yarik Briukhovetskyi).Why it matters
This feature addresses the limitation where theIN operator only accepted constant arrays or sets as its second argument. By enabling non-constant and tuple arguments, users can write more flexible and dynamic queries, improving expressiveness and simplifying queries where the set of values to compare against is computed or derived from subqueries.How to use it
Simply use theIN operator with a non-constant second argument, such as a subquery or tuple, in your SQL queries, for example:SELECT FROM table WHERE column IN (SELECT id FROM other_table);or
SELECT FROM table WHERE (col1, col2) IN ((1, 2), (3, 4));