diff --git a/src/test/regress/expected/single_node.out b/src/test/regress/expected/single_node.out index b2f6b01d3..ea73d9fa0 100644 --- a/src/test/regress/expected/single_node.out +++ b/src/test/regress/expected/single_node.out @@ -49,6 +49,13 @@ SELECT create_reference_table('ref'); (1 row) CREATE TABLE local(c int, d int); +CREATE TABLE public.another_schema_table(a int); +SELECT create_distributed_table('public.another_schema_table', 'a'); + create_distributed_table +--------------------------------------------------------------------- + +(1 row) + -- Confirm the basics work INSERT INTO test VALUES (1, 2), (3, 4), (5, 6), (2, 7), (4, 5); SELECT * FROM test WHERE x = 1; @@ -130,7 +137,24 @@ BEGIN; INSERT INTO test VALUES (1, 2); COMMIT; CREATE INDEX single_node_i1 ON test(x); -DROP INDEX single_node_i1; +CREATE INDEX single_node_i2 ON test(x,y); +REINDEX SCHEMA single_node; +-- PG 11 does not support CONCURRENTLY +-- and we do not want to add a new output +-- file just for that. Enable the test +-- once we remove PG_VERSION_11 +--REINDEX SCHEMA CONCURRENTLY single_node; +-- keep one of the indexes +-- drop w/wout tx blocks +BEGIN; + DROP INDEX single_node_i2; +ROLLBACK; +DROP INDEX single_node_i2; +-- change the schema w/wout TX block +BEGIN; + ALTER TABLE public.another_schema_table SET SCHEMA single_node; +ROLLBACK; +ALTER TABLE public.another_schema_table SET SCHEMA single_node; BEGIN; TRUNCATE test; SELECT * FROM test; diff --git a/src/test/regress/sql/single_node.sql b/src/test/regress/sql/single_node.sql index a0ab64b35..c081236db 100644 --- a/src/test/regress/sql/single_node.sql +++ b/src/test/regress/sql/single_node.sql @@ -30,6 +30,8 @@ CREATE TABLE ref(a int, b int); SELECT create_reference_table('ref'); CREATE TABLE local(c int, d int); +CREATE TABLE public.another_schema_table(a int); +SELECT create_distributed_table('public.another_schema_table', 'a'); -- Confirm the basics work INSERT INTO test VALUES (1, 2), (3, 4), (5, 6), (2, 7), (4, 5); @@ -71,7 +73,27 @@ BEGIN; COMMIT; CREATE INDEX single_node_i1 ON test(x); -DROP INDEX single_node_i1; +CREATE INDEX single_node_i2 ON test(x,y); +REINDEX SCHEMA single_node; + +-- PG 11 does not support CONCURRENTLY +-- and we do not want to add a new output +-- file just for that. Enable the test +-- once we remove PG_VERSION_11 +--REINDEX SCHEMA CONCURRENTLY single_node; + +-- keep one of the indexes +-- drop w/wout tx blocks +BEGIN; + DROP INDEX single_node_i2; +ROLLBACK; +DROP INDEX single_node_i2; + +-- change the schema w/wout TX block +BEGIN; + ALTER TABLE public.another_schema_table SET SCHEMA single_node; +ROLLBACK; +ALTER TABLE public.another_schema_table SET SCHEMA single_node; BEGIN; TRUNCATE test;