From daf31ab4b2145c63469cb69108985c778c7c71bb Mon Sep 17 00:00:00 2001 From: Michael Paquier Date: Tue, 6 Aug 2024 10:14:36 +0900 Subject: [PATCH] Improve test portability of plpgsql scenario This test expects query IDs to be computed without the hint table, checking that compute_query_id is either "on" or "auto" when running the tests. The test would fail should compute_query_id be set to off on a cluster where the regression tests are run. There are no reasons why the test should not just use compute_query_id = on now that we don't depend on pg_stat_statements anymore since 8e296b66e34f for the regression tests of pg_hint_plan. So let's just force it, improving the portability of the tests. Backpatch-through: 17 --- expected/plpgsql.out | 7 +------ sql/plpgsql.sql | 2 +- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/expected/plpgsql.out b/expected/plpgsql.out index bde17aed..c6dc22c3 100644 --- a/expected/plpgsql.out +++ b/expected/plpgsql.out @@ -6,12 +6,7 @@ SET client_min_messages TO log; \set SHOW_CONTEXT always LOAD 'pg_hint_plan'; SET pg_hint_plan.debug_print TO on; -SELECT setting <> 'off' FROM pg_settings WHERE name = 'compute_query_id'; - ?column? ----------- - t -(1 row) - +SET compute_query_id = on; SHOW pg_hint_plan.enable_hint_table; pg_hint_plan.enable_hint_table -------------------------------- diff --git a/sql/plpgsql.sql b/sql/plpgsql.sql index 39a1aed0..1786932b 100644 --- a/sql/plpgsql.sql +++ b/sql/plpgsql.sql @@ -8,7 +8,7 @@ SET client_min_messages TO log; LOAD 'pg_hint_plan'; SET pg_hint_plan.debug_print TO on; -SELECT setting <> 'off' FROM pg_settings WHERE name = 'compute_query_id'; +SET compute_query_id = on; SHOW pg_hint_plan.enable_hint_table; -- Internal handling of hints within plpgsql functions.