@@ -52,6 +52,7 @@ GRANT :ROLE_DEFAULT_PERM_USER_2 TO :ROLE_DEFAULT_PERM_USER;
52
52
SELECT attach_tablespace(' tablespace2' , ' tspace_2dim' );
53
53
54
54
SELECT * FROM _timescaledb_catalog .tablespace ;
55
+ SELECT * FROM show_tablespaces(' tspace_2dim' );
55
56
56
57
-- insert into another chunk
57
58
INSERT INTO tspace_2dim VALUES (' 2017-01-20T09:00:01' , 24 .3 , ' brown' );
@@ -87,10 +88,14 @@ INNER JOIN _timescaledb_catalog.chunk ch ON (ch.table_name = c.relname);
87
88
-- should only detach from 'tspace_1dim' (1 tablespace)
88
89
SELECT detach_tablespace(' tablespace1' );
89
90
SELECT * FROM _timescaledb_catalog .tablespace ;
91
+ SELECT * FROM show_tablespaces(' tspace_1dim' );
92
+ SELECT * FROM show_tablespaces(' tspace_2dim' );
90
93
91
94
-- detach the other tablespace
92
95
SELECT detach_tablespace(' tablespace2' , ' tspace_1dim' );
93
96
SELECT * FROM _timescaledb_catalog .tablespace ;
97
+ SELECT * FROM show_tablespaces(' tspace_1dim' );
98
+ SELECT * FROM show_tablespaces(' tspace_2dim' );
94
99
95
100
-- detaching a tablespace from table without permissions should fail
96
101
SELECT detach_tablespace(' tablespace2' , ' tspace_2dim' );
@@ -100,6 +105,8 @@ SELECT detach_tablespaces('tspace_2dim');
100
105
SET ROLE :ROLE_DEFAULT_PERM_USER;
101
106
SELECT detach_tablespaces(' tspace_2dim' );
102
107
SELECT * FROM _timescaledb_catalog .tablespace ;
108
+ SELECT * FROM show_tablespaces(' tspace_1dim' );
109
+ SELECT * FROM show_tablespaces(' tspace_2dim' );
103
110
104
111
-- cleanup
105
112
DROP TABLE tspace_1dim CASCADE;
0 commit comments