1
0
mirror of https://github.com/postgres/postgres.git synced 2025-10-16 17:07:43 +03:00

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.
This commit is contained in:
Tom Lane
2025-09-12 18:45:06 -04:00
parent 9a71989a8f
commit 88824e6861
2 changed files with 8 additions and 4 deletions

View File

@@ -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;

View File

@@ -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