Skip to content

Commit 0af0504

Browse files
committed
Adjust test case added by commit 6136e94.
Per project policy, transient roles created by regression test cases should be named "regress_something", to reduce the risks of running such cases against installed servers. And no such role should ever be left behind after running a test. Discussion: https://postgr.es/m/11297.1576868677@sss.pgh.pa.us
1 parent e60b480 commit 0af0504

File tree

2 files changed

+19
-10
lines changed

2 files changed

+19
-10
lines changed

contrib/postgres_fdw/expected/postgres_fdw.out

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8813,9 +8813,9 @@ SELECT b, avg(a), max(a), count(*) FROM pagg_tab GROUP BY b HAVING sum(a) < 700
88138813
-- access rights and superuser
88148814
-- ===================================================================
88158815
-- Non-superuser cannot create a FDW without a password in the connstr
8816-
CREATE ROLE nosuper NOSUPERUSER;
8817-
GRANT USAGE ON FOREIGN DATA WRAPPER postgres_fdw TO nosuper;
8818-
SET ROLE nosuper;
8816+
CREATE ROLE regress_nosuper NOSUPERUSER;
8817+
GRANT USAGE ON FOREIGN DATA WRAPPER postgres_fdw TO regress_nosuper;
8818+
SET ROLE regress_nosuper;
88198819
SHOW is_superuser;
88208820
is_superuser
88218821
--------------
@@ -8877,8 +8877,8 @@ DETAIL: Non-superuser cannot connect if the server does not request a password.
88778877
HINT: Target server's authentication method must be changed or password_required=false set in the user mapping attributes.
88788878
RESET ROLE;
88798879
-- But the superuser can
8880-
ALTER USER MAPPING FOR nosuper SERVER loopback_nopw OPTIONS (ADD password_required 'false');
8881-
SET ROLE nosuper;
8880+
ALTER USER MAPPING FOR regress_nosuper SERVER loopback_nopw OPTIONS (ADD password_required 'false');
8881+
SET ROLE regress_nosuper;
88828882
-- Should finally work now
88838883
SELECT * FROM ft1_nopw LIMIT 1;
88848884
c1 | c2 | c3 | c4 | c5 | c6 | c7 | c8
@@ -8903,6 +8903,10 @@ SELECT * FROM ft1_nopw LIMIT 1;
89038903
1111 | 2 | | | | | ft1 |
89048904
(1 row)
89058905

8906+
-- cleanup
8907+
DROP USER MAPPING FOR public SERVER loopback_nopw;
8908+
DROP OWNED BY regress_nosuper;
8909+
DROP ROLE regress_nosuper;
89068910
-- Clean-up
89078911
RESET enable_partitionwise_aggregate;
89088912
-- Two-phase transactions are not supported.

contrib/postgres_fdw/sql/postgres_fdw.sql

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2498,11 +2498,11 @@ SELECT b, avg(a), max(a), count(*) FROM pagg_tab GROUP BY b HAVING sum(a) < 700
24982498
-- ===================================================================
24992499

25002500
-- Non-superuser cannot create a FDW without a password in the connstr
2501-
CREATE ROLE nosuper NOSUPERUSER;
2501+
CREATE ROLE regress_nosuper NOSUPERUSER;
25022502

2503-
GRANT USAGE ON FOREIGN DATA WRAPPER postgres_fdw TO nosuper;
2503+
GRANT USAGE ON FOREIGN DATA WRAPPER postgres_fdw TO regress_nosuper;
25042504

2505-
SET ROLE nosuper;
2505+
SET ROLE regress_nosuper;
25062506

25072507
SHOW is_superuser;
25082508

@@ -2559,9 +2559,9 @@ SELECT * FROM ft1_nopw LIMIT 1;
25592559
RESET ROLE;
25602560

25612561
-- But the superuser can
2562-
ALTER USER MAPPING FOR nosuper SERVER loopback_nopw OPTIONS (ADD password_required 'false');
2562+
ALTER USER MAPPING FOR regress_nosuper SERVER loopback_nopw OPTIONS (ADD password_required 'false');
25632563

2564-
SET ROLE nosuper;
2564+
SET ROLE regress_nosuper;
25652565

25662566
-- Should finally work now
25672567
SELECT * FROM ft1_nopw LIMIT 1;
@@ -2580,6 +2580,11 @@ RESET ROLE;
25802580
-- mapping option, but will work because the current user is a superuser.
25812581
SELECT * FROM ft1_nopw LIMIT 1;
25822582

2583+
-- cleanup
2584+
DROP USER MAPPING FOR public SERVER loopback_nopw;
2585+
DROP OWNED BY regress_nosuper;
2586+
DROP ROLE regress_nosuper;
2587+
25832588
-- Clean-up
25842589
RESET enable_partitionwise_aggregate;
25852590

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