Regression tests for ALTER TABLESPACE RENAME,OWNER
Hari Babu Kommi reviewed by David Rowley
This commit is contained in:
parent
b5e0a2a384
commit
b921a26fb8
@ -54,7 +54,22 @@ CREATE TABLE bar (i int) TABLESPACE nosuchspace;
|
|||||||
-- Fail, not empty
|
-- Fail, not empty
|
||||||
DROP TABLESPACE testspace;
|
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;
|
DROP SCHEMA testschema CASCADE;
|
||||||
|
|
||||||
-- Should succeed
|
-- Should succeed
|
||||||
DROP TABLESPACE testspace;
|
DROP TABLESPACE testspace_renamed;
|
||||||
|
|
||||||
|
DROP ROLE tablespace_testuser1;
|
||||||
|
DROP ROLE tablespace_testuser2;
|
||||||
|
@ -72,6 +72,14 @@ ERROR: tablespace "nosuchspace" does not exist
|
|||||||
-- Fail, not empty
|
-- Fail, not empty
|
||||||
DROP TABLESPACE testspace;
|
DROP TABLESPACE testspace;
|
||||||
ERROR: tablespace "testspace" is not empty
|
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;
|
DROP SCHEMA testschema CASCADE;
|
||||||
NOTICE: drop cascades to 4 other objects
|
NOTICE: drop cascades to 4 other objects
|
||||||
DETAIL: drop cascades to table testschema.foo
|
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.asexecute
|
||||||
drop cascades to table testschema.atable
|
drop cascades to table testschema.atable
|
||||||
-- Should succeed
|
-- Should succeed
|
||||||
DROP TABLESPACE testspace;
|
DROP TABLESPACE testspace_renamed;
|
||||||
|
DROP ROLE tablespace_testuser1;
|
||||||
|
DROP ROLE tablespace_testuser2;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user