summaryrefslogtreecommitdiff
path: root/src/test/regress/input/tablespace.source
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/regress/input/tablespace.source')
-rw-r--r--src/test/regress/input/tablespace.source11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/test/regress/input/tablespace.source b/src/test/regress/input/tablespace.source
index 9e2c358094..df5479d589 100644
--- a/src/test/regress/input/tablespace.source
+++ b/src/test/regress/input/tablespace.source
@@ -28,6 +28,17 @@ CREATE INDEX foo_idx on testschema.foo(i) TABLESPACE testspace;
SELECT relname, spcname FROM pg_catalog.pg_tablespace t, pg_catalog.pg_class c
where c.reltablespace = t.oid AND c.relname = 'foo_idx';
+-- let's try moving a table from one place to another
+CREATE TABLE testschema.atable AS VALUES (1), (2);
+CREATE UNIQUE INDEX anindex ON testschema.atable(column1);
+
+ALTER TABLE testschema.atable SET TABLESPACE testspace;
+ALTER INDEX testschema.anindex SET TABLESPACE testspace;
+
+INSERT INTO testschema.atable VALUES(3); -- ok
+INSERT INTO testschema.atable VALUES(1); -- fail (checks index)
+SELECT COUNT(*) FROM testschema.atable; -- checks heap
+
-- Will fail with bad path
CREATE TABLESPACE badspace LOCATION '/no/such/location';