Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0af0504

Browse files
committed
Adjust test case added by commit6136e94.
Per project policy, transient roles created by regression test casesshould be named "regress_something", to reduce the risks of runningsuch cases against installed servers. And no such role should everbe left behind after running a test.Discussion:https://postgr.es/m/11297.1576868677@sss.pgh.pa.us
1 parente60b480 commit0af0504

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 ROLEnosuper NOSUPERUSER;
8817-
GRANT USAGE ON FOREIGN DATA WRAPPER postgres_fdw TOnosuper;
8818-
SET ROLEnosuper;
8816+
CREATE ROLEregress_nosuper NOSUPERUSER;
8817+
GRANT USAGE ON FOREIGN DATA WRAPPER postgres_fdw TOregress_nosuper;
8818+
SET ROLEregress_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 FORnosuper SERVER loopback_nopw OPTIONS (ADD password_required 'false');
8881-
SET ROLEnosuper;
8880+
ALTER USER MAPPING FORregress_nosuper SERVER loopback_nopw OPTIONS (ADD password_required 'false');
8881+
SET ROLEregress_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 ROLEnosuper NOSUPERUSER;
2501+
CREATE ROLEregress_nosuper NOSUPERUSER;
25022502

2503-
GRANT USAGEON FOREIGN DATA WRAPPER postgres_fdw TOnosuper;
2503+
GRANT USAGEON FOREIGN DATA WRAPPER postgres_fdw TOregress_nosuper;
25042504

2505-
SET ROLEnosuper;
2505+
SET ROLEregress_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-
ALTERUSER MAPPING FORnosuper SERVER loopback_nopw OPTIONS (ADD password_required'false');
2562+
ALTERUSER MAPPING FORregress_nosuper SERVER loopback_nopw OPTIONS (ADD password_required'false');
25632563

2564-
SET ROLEnosuper;
2564+
SET ROLEregress_nosuper;
25652565

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

2583+
-- cleanup
2584+
DROPUSER 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)

[8]ページ先頭

©2009-2025 Movatter.jp