pg_hint_plan icon indicating copy to clipboard operation
pg_hint_plan copied to clipboard

Fix issue with ignoring prepared statements that have array parameters (because of square brackets [])

Open WinterUnicorn opened this issue 2 years ago • 0 comments

We have an issues with prepared statements that use arrays as arguments. In this case pg_hint_plan don't pass preceding sql check.

Example:

prepare test_query(numeric[]) as /*+ MergeJoin(t1 t2) */ with test as (select 1 as x) select t1.* from test t1, test t2 where t1.x=any($1) and t1.x = t2.x;

explain execute test_query(array[1,2,3]); 
-- MergeJoin hint will be ignored because of numeric[] parameter

deallocate test_query;

This request to add the '[', ']' symbols into the white list.

WinterUnicorn avatar Jun 20 '22 04:06 WinterUnicorn