File tree 2 files changed +27
-2
lines changed
2 files changed +27
-2
lines changed Original file line number Diff line number Diff line change @@ -54,7 +54,22 @@ CREATE TABLE bar (i int) TABLESPACE nosuchspace;
54
54
-- Fail, not empty
55
55
DROP TABLESPACE testspace;
56
56
57
+ CREATE ROLE tablespace_testuser1 login;
58
+ CREATE ROLE tablespace_testuser2 login;
59
+
60
+ ALTER TABLESPACE testspace OWNER TO tablespace_testuser1;
61
+
62
+ SET SESSION ROLE tablespace_testuser2;
63
+ CREATE TABLE tablespace_table (i int) TABLESPACE testspace; -- fail
64
+
65
+ \c -
66
+
67
+ ALTER TABLESPACE testspace RENAME TO testspace_renamed;
68
+
57
69
DROP SCHEMA testschema CASCADE;
58
70
59
71
-- Should succeed
60
- DROP TABLESPACE testspace;
72
+ DROP TABLESPACE testspace_renamed;
73
+
74
+ DROP ROLE tablespace_testuser1;
75
+ DROP ROLE tablespace_testuser2;
Original file line number Diff line number Diff line change @@ -72,11 +72,21 @@ ERROR: tablespace "nosuchspace" does not exist
72
72
-- Fail, not empty
73
73
DROP TABLESPACE testspace;
74
74
ERROR: tablespace "testspace" is not empty
75
+ CREATE ROLE tablespace_testuser1 login;
76
+ CREATE ROLE tablespace_testuser2 login;
77
+ ALTER TABLESPACE testspace OWNER TO tablespace_testuser1;
78
+ SET SESSION ROLE tablespace_testuser2;
79
+ CREATE TABLE tablespace_table (i int) TABLESPACE testspace; -- fail
80
+ ERROR: permission denied for tablespace testspace
81
+ \c -
82
+ ALTER TABLESPACE testspace RENAME TO testspace_renamed;
75
83
DROP SCHEMA testschema CASCADE;
76
84
NOTICE: drop cascades to 4 other objects
77
85
DETAIL: drop cascades to table testschema.foo
78
86
drop cascades to table testschema.asselect
79
87
drop cascades to table testschema.asexecute
80
88
drop cascades to table testschema.atable
81
89
-- Should succeed
82
- DROP TABLESPACE testspace;
90
+ DROP TABLESPACE testspace_renamed;
91
+ DROP ROLE tablespace_testuser1;
92
+ DROP ROLE tablespace_testuser2;
You can’t perform that action at this time.
0 commit comments