From 88824e68611a88a4ef7218c093810a94f86e12e0 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Fri, 12 Sep 2025 18:45:06 -0400 Subject: [PATCH] Avoid context dependency in test case added by 9a71989a8. It's not quite clear to me why this didn't show up in my local check-world testing, but some of the buildfarm evidently runs this test with a different database name. Adjust the test so that that doesn't affect the reported error messages. --- src/test/modules/unsafe_tests/expected/setconfig.out | 8 ++++---- src/test/modules/unsafe_tests/sql/setconfig.sql | 4 ++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/test/modules/unsafe_tests/expected/setconfig.out b/src/test/modules/unsafe_tests/expected/setconfig.out index 37e33709012..5318f075d1e 100644 --- a/src/test/modules/unsafe_tests/expected/setconfig.out +++ b/src/test/modules/unsafe_tests/expected/setconfig.out @@ -63,18 +63,18 @@ SET ROLE NONE; DO $$BEGIN EXECUTE format( 'ALTER DATABASE %I RESET role', current_catalog); END$$; -- Test some error cases +-- We have to use terse mode so that the database name doesn't +-- appear in the error output. +\set VERBOSITY terse DO $$BEGIN EXECUTE format( 'ALTER DATABASE %I SET bogus = 0', current_catalog); END$$; ERROR: unrecognized configuration parameter "bogus" -CONTEXT: SQL statement "ALTER DATABASE contrib_regression SET bogus = 0" -PL/pgSQL function inline_code_block line 1 at EXECUTE DO $$BEGIN EXECUTE format( 'ALTER DATABASE %I RESET bogus', current_catalog); END$$; ERROR: unrecognized configuration parameter "bogus" -CONTEXT: SQL statement "ALTER DATABASE contrib_regression RESET bogus" -PL/pgSQL function inline_code_block line 1 at EXECUTE ALTER USER regress_authenticated_user_db_ssa RESET bogus; ERROR: unrecognized configuration parameter "bogus" +\set VERBOSITY default -- Test connection string options \c -reuse-previous=on "user=regress_authenticated_user_db_sr options=-crole=regress_current_user" SELECT current_user, session_user; diff --git a/src/test/modules/unsafe_tests/sql/setconfig.sql b/src/test/modules/unsafe_tests/sql/setconfig.sql index d9e1fc908a1..4349490f941 100644 --- a/src/test/modules/unsafe_tests/sql/setconfig.sql +++ b/src/test/modules/unsafe_tests/sql/setconfig.sql @@ -51,12 +51,16 @@ DO $$BEGIN EXECUTE format( -- Test some error cases +-- We have to use terse mode so that the database name doesn't +-- appear in the error output. +\set VERBOSITY terse DO $$BEGIN EXECUTE format( 'ALTER DATABASE %I SET bogus = 0', current_catalog); END$$; DO $$BEGIN EXECUTE format( 'ALTER DATABASE %I RESET bogus', current_catalog); END$$; ALTER USER regress_authenticated_user_db_ssa RESET bogus; +\set VERBOSITY default -- Test connection string options -- 2.39.5