Skip to content

Commit b22b770

Browse files
committed
Make repeated 'make installcheck' runs work
In pg_audit, set client_min_messages up to warning, then reset the role attributes, to completely reset the session while not making the regression tests depend on being run by any particular user.
1 parent ed6ea8e commit b22b770

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

contrib/pg_audit/expected/pg_audit.out

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1054,6 +1054,11 @@ GRANT user1 TO user2;
10541054
NOTICE: AUDIT: SESSION,59,1,ROLE,GRANT ROLE,,,GRANT user1 TO user2;,<none>
10551055
REVOKE user1 FROM user2;
10561056
NOTICE: AUDIT: SESSION,60,1,ROLE,REVOKE ROLE,,,REVOKE user1 FROM user2;,<none>
1057+
-- Cleanup
1058+
-- Set client_min_messages up to warning to avoid noise
1059+
SET client_min_messages = 'warning';
1060+
ALTER ROLE :current_user RESET pg_audit.log;
1061+
ALTER ROLE :current_user RESET pg_audit.log_level;
10571062
DROP TABLE test.account_copy;
10581063
DROP TABLE test.test_insert;
10591064
DROP SCHEMA test;
@@ -1064,8 +1069,6 @@ DROP TABLE hoge;
10641069
DROP TABLE account;
10651070
DROP TABLE account_role_map;
10661071
DROP USER user2;
1067-
NOTICE: AUDIT: SESSION,61,1,ROLE,DROP ROLE,,,DROP USER user2;,<none>
10681072
DROP USER user1;
1069-
NOTICE: AUDIT: SESSION,62,1,ROLE,DROP ROLE,,,DROP USER user1;,<none>
10701073
DROP ROLE auditor;
1071-
NOTICE: AUDIT: SESSION,63,1,ROLE,DROP ROLE,,,DROP ROLE auditor;,<none>
1074+
RESET client_min_messages;

contrib/pg_audit/sql/pg_audit.sql

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -646,6 +646,13 @@ SET pg_audit.log = 'role';
646646
GRANT user1 TO user2;
647647
REVOKE user1 FROM user2;
648648

649+
-- Cleanup
650+
-- Set client_min_messages up to warning to avoid noise
651+
SET client_min_messages = 'warning';
652+
653+
ALTER ROLE :current_user RESET pg_audit.log;
654+
ALTER ROLE :current_user RESET pg_audit.log_level;
655+
649656
DROP TABLE test.account_copy;
650657
DROP TABLE test.test_insert;
651658
DROP SCHEMA test;
@@ -658,3 +665,5 @@ DROP TABLE account_role_map;
658665
DROP USER user2;
659666
DROP USER user1;
660667
DROP ROLE auditor;
668+
669+
RESET client_min_messages;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy