@@ -94,8 +94,8 @@ sub psql_command
9494
9595# Create temporary roles and log table
9696psql_command(
97- $node , ' CREATE ROLE alice WITH LOGIN;
98- CREATE ROLE mallory WITH LOGIN;
97+ $node , ' CREATE ROLE regress_alice WITH LOGIN;
98+ CREATE ROLE regress_mallory WITH LOGIN;
9999CREATE TABLE user_logins(id serial, who text);
100100GRANT SELECT ON user_logins TO public;
101101' , 0, ' create tmp objects' ,
@@ -109,7 +109,7 @@ sub psql_command
109109 ' CREATE FUNCTION on_login_proc() RETURNS event_trigger AS $$
110110BEGIN
111111 INSERT INTO user_logins (who) VALUES (SESSION_USER);
112- IF SESSION_USER = \' mallory \' THEN
112+ IF SESSION_USER = \' regress_mallory \' THEN
113113 RAISE EXCEPTION \' Hello %! You are NOT welcome here!\' , SESSION_USER;
114114 END IF;
115115 RAISE NOTICE \' Hello %! You are welcome!\' , SESSION_USER;
@@ -140,29 +140,29 @@ BEGIN
140140
141141# Try to log as allowed Alice and disallowed Mallory (two times)
142142psql_command(
143- $node , ' SELECT 1;' , 0, ' try alice ' ,
144- connstr => ' user=alice ' ,
143+ $node , ' SELECT 1;' , 0, ' try regress_alice ' ,
144+ connstr => ' user=regress_alice ' ,
145145 log_exact => ' 1' ,
146146 err_like => [qr / You are welcome/ ],
147147 err_unlike => [qr / You are NOT welcome/ ]);
148148psql_command(
149- $node , ' SELECT 1;' , 2, ' try mallory ' ,
150- connstr => ' user=mallory ' ,
149+ $node , ' SELECT 1;' , 2, ' try regress_mallory ' ,
150+ connstr => ' user=regress_mallory ' ,
151151 log_exact => ' ' ,
152152 err_like => [qr / You are NOT welcome/ ],
153153 err_unlike => [qr / You are welcome/ ]);
154154psql_command(
155- $node , ' SELECT 1;' , 2, ' try mallory ' ,
156- connstr => ' user=mallory ' ,
155+ $node , ' SELECT 1;' , 2, ' try regress_mallory ' ,
156+ connstr => ' user=regress_mallory ' ,
157157 log_exact => ' ' ,
158158 err_like => [qr / You are NOT welcome/ ],
159159 err_unlike => [qr / You are welcome/ ]);
160160
161161# Check that Alice's login record is here, while the Mallory's one is not
162162psql_command(
163163 $node , ' SELECT * FROM user_logins;' , 0, ' select *' ,
164- log_like => [qr / 3\| alice / ],
165- log_unlike => [qr /mallory / ],
164+ log_like => [qr / 3\| regress_alice / ],
165+ log_unlike => [qr /regress_mallory / ],
166166 err_like => [qr / You are welcome/ ]);
167167
168168# Check total number of successful logins so far
@@ -180,8 +180,8 @@ BEGIN
180180psql_command(
181181 $node , ' DROP TABLE user_logins;
182182DROP FUNCTION on_login_proc;
183- DROP ROLE mallory ;
184- DROP ROLE alice ;
183+ DROP ROLE regress_mallory ;
184+ DROP ROLE regress_alice ;
185185' , 0, ' cleanup' ,
186186 log_exact => ' ' ,
187187 err_exact => ' ' );
0 commit comments