From 0c08be45a8d2b6f16299de698dec5d0197d5dfc1 Mon Sep 17 00:00:00 2001 From: Michael Paquier Date: Tue, 20 Aug 2024 12:52:39 +0900 Subject: [PATCH] Remove use of session_preload_libraries in regression tests session_preload_libraries was not really required with its set of ALTER DATABASE SET commands to updates some GUCs. There were equivalent LOAD and SET commands used in the tests where session_preload_libraries was defined, and the same GUCs were set twice. This simplifies the tests, while shaving some cycles to run the tests. Backpatch-through: 17 --- expected/ut-G.out | 1 - expected/ut-S.out | 7 ------- expected/ut-W.out | 8 -------- sql/ut-G.sql | 2 -- sql/ut-S.sql | 8 -------- sql/ut-W.sql | 4 ---- 6 files changed, 30 deletions(-) diff --git a/expected/ut-G.out b/expected/ut-G.out index 628355fb..e04afe79 100644 --- a/expected/ut-G.out +++ b/expected/ut-G.out @@ -675,7 +675,6 @@ error hint: Filter: ((ctid = '(1,1)'::tid) AND (c1 = 1)) (65 rows) -RESET client_min_messages; ---- ---- No. G-2-1 GUC parameter ---- diff --git a/expected/ut-S.out b/expected/ut-S.out index f09f61b6..d3e40ba1 100644 --- a/expected/ut-S.out +++ b/expected/ut-S.out @@ -1,11 +1,4 @@ LOAD 'pg_hint_plan'; --- Force some GUCs. -SELECT current_database() AS datname \gset -ALTER DATABASE :"datname" SET client_min_messages = 'log'; -ALTER DATABASE :"datname" SET pg_hint_plan.debug_print = 'on'; -ALTER DATABASE :"datname" SET session_preload_libraries TO 'pg_hint_plan'; --- Force GUC reload with a reconnection -\c SET pg_hint_plan.enable_hint TO on; SET pg_hint_plan.debug_print TO on; SET client_min_messages TO LOG; diff --git a/expected/ut-W.out b/expected/ut-W.out index ce2a055a..a09bd341 100644 --- a/expected/ut-W.out +++ b/expected/ut-W.out @@ -1,5 +1,4 @@ LOAD 'pg_hint_plan'; -ALTER SYSTEM SET session_preload_libraries TO 'pg_hint_plan'; SET pg_hint_plan.enable_hint TO on; SET pg_hint_plan.debug_print TO on; SET client_min_messages TO LOG; @@ -1424,10 +1423,3 @@ error hint: Filter: ((id % 2) = 0) (28 rows) -ALTER SYSTEM SET session_preload_libraries TO DEFAULT; -SELECT pg_reload_conf(); - pg_reload_conf ----------------- - t -(1 row) - diff --git a/sql/ut-G.sql b/sql/ut-G.sql index ea041932..53d34567 100644 --- a/sql/ut-G.sql +++ b/sql/ut-G.sql @@ -44,8 +44,6 @@ Set(enable_tidscan off)Set(enable_nestloop off) */ EXPLAIN (COSTS false) UPDATE s1.r3_ SET c1 = c1 WHERE c1 = 1 AND ctid = '(1,1)'; -RESET client_min_messages; - ---- ---- No. G-2-1 GUC parameter ---- diff --git a/sql/ut-S.sql b/sql/ut-S.sql index 511b3d89..5e622cb0 100644 --- a/sql/ut-S.sql +++ b/sql/ut-S.sql @@ -1,12 +1,4 @@ LOAD 'pg_hint_plan'; - --- Force some GUCs. -SELECT current_database() AS datname \gset -ALTER DATABASE :"datname" SET client_min_messages = 'log'; -ALTER DATABASE :"datname" SET pg_hint_plan.debug_print = 'on'; -ALTER DATABASE :"datname" SET session_preload_libraries TO 'pg_hint_plan'; --- Force GUC reload with a reconnection -\c SET pg_hint_plan.enable_hint TO on; SET pg_hint_plan.debug_print TO on; SET client_min_messages TO LOG; diff --git a/sql/ut-W.sql b/sql/ut-W.sql index ed303776..8603be05 100644 --- a/sql/ut-W.sql +++ b/sql/ut-W.sql @@ -1,5 +1,4 @@ LOAD 'pg_hint_plan'; -ALTER SYSTEM SET session_preload_libraries TO 'pg_hint_plan'; SET pg_hint_plan.enable_hint TO on; SET pg_hint_plan.debug_print TO on; SET client_min_messages TO LOG; @@ -233,6 +232,3 @@ SELECT id FROM ft1 UNION ALL SELECT x FROM (VALUES (1), (2), (3)) t(x); '); - -ALTER SYSTEM SET session_preload_libraries TO DEFAULT; -SELECT pg_reload_conf();