git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b5e0a2a)
Regression tests for ALTER TABLESPACE RENAME,OWNER
2013年12月11日 20:42:58 +0000 (20:42 +0000)
2013年12月11日 20:42:58 +0000 (20:42 +0000)
Hari Babu Kommi reviewed by David Rowley


diff --git a/src/test/regress/input/tablespace.source b/src/test/regress/input/tablespace.source
index dba96f4547fa34424ee76dccaa676e8a21f0c7c6..4f17b09fa94883864d3a1735e2db03436a3bf161 100644 (file)
--- a/src/test/regress/input/tablespace.source
+++ b/src/test/regress/input/tablespace.source
@@ -54,7 +54,22 @@ CREATE TABLE bar (i int) TABLESPACE nosuchspace;
-- Fail, not empty
DROP TABLESPACE testspace;
+CREATE ROLE tablespace_testuser1 login;
+CREATE ROLE tablespace_testuser2 login;
+
+ALTER TABLESPACE testspace OWNER TO tablespace_testuser1;
+
+SET SESSION ROLE tablespace_testuser2;
+CREATE TABLE tablespace_table (i int) TABLESPACE testspace; -- fail
+
+\c -
+
+ALTER TABLESPACE testspace RENAME TO testspace_renamed;
+
DROP SCHEMA testschema CASCADE;
-- Should succeed
-DROP TABLESPACE testspace;
+DROP TABLESPACE testspace_renamed;
+
+DROP ROLE tablespace_testuser1;
+DROP ROLE tablespace_testuser2;
diff --git a/src/test/regress/output/tablespace.source b/src/test/regress/output/tablespace.source
index 1260c968880df44aa0698f1415e0be5265a7df7e..2868169c6ceecc09fca5ed046760af743b1deb06 100644 (file)
--- a/src/test/regress/output/tablespace.source
+++ b/src/test/regress/output/tablespace.source
@@ -72,6 +72,14 @@ ERROR: tablespace "nosuchspace" does not exist
-- Fail, not empty
DROP TABLESPACE testspace;
ERROR: tablespace "testspace" is not empty
+CREATE ROLE tablespace_testuser1 login;
+CREATE ROLE tablespace_testuser2 login;
+ALTER TABLESPACE testspace OWNER TO tablespace_testuser1;
+SET SESSION ROLE tablespace_testuser2;
+CREATE TABLE tablespace_table (i int) TABLESPACE testspace; -- fail
+ERROR: permission denied for tablespace testspace
+\c -
+ALTER TABLESPACE testspace RENAME TO testspace_renamed;
DROP SCHEMA testschema CASCADE;
NOTICE: drop cascades to 4 other objects
DETAIL: drop cascades to table testschema.foo
@@ -79,4 +87,6 @@ drop cascades to table testschema.asselect
drop cascades to table testschema.asexecute
drop cascades to table testschema.atable
-- Should succeed
-DROP TABLESPACE testspace;
+DROP TABLESPACE testspace_renamed;
+DROP ROLE tablespace_testuser1;
+DROP ROLE tablespace_testuser2;
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /