pg_hint_plan icon indicating copy to clipboard operation
pg_hint_plan copied to clipboard

Query Errors if pg_hint_plan.enable_hint_table and enable_hint is enabled but hints table does not exist

Open samimseih opened this issue 9 months ago • 15 comments

if a user enables enable_hint_table and enable_hint but the hint_plan.hints does not exist, it will lead to query failure.

I don't think this should result in an error, but should be silently ignored ( with a message with debug_print )

postgres=# set pg_hint_plan.enable_hint_table = "on";
SET
postgres=# set pg_hint_plan.enable_hint = "on";
SET
postgres=# select 1;
ERROR:  relation "hint_plan.hints" does not exist
LINE 1: SELECT hints   FROM hint_plan.hints  WHERE norm_query_string...
                            ^
QUERY:  SELECT hints   FROM hint_plan.hints  WHERE norm_query_string = $1    AND ( application_name = $2     OR application_name = '' )  ORDER BY application_name DESC

Regards,

Sami

samimseih avatar May 04 '24 17:05 samimseih