Fix psql-dependent schema support tests

pull/1439/head
Jason Petersen 2017-05-31 14:53:25 -06:00
parent a479dd5cd8
commit 4ed2f653cd
No known key found for this signature in database
GPG Key ID: 9F1D3510D110ABA9
2 changed files with 60 additions and 108 deletions

View File

@ -586,8 +586,7 @@ ALTER TABLE test_schema_support.nation_hash ADD COLUMN new_col INT;
NOTICE: using one-phase commit for distributed DDL commands
HINT: You can enable two-phase commit for extra safety with: SET citus.multi_shard_commit_protocol TO '2pc'
-- verify column is added
\d test_schema_support.nation_hash;
Table "test_schema_support.nation_hash"
SELECT "Column", "Type", "Modifiers" FROM table_desc WHERE relid='test_schema_support.nation_hash'::regclass;
Column | Type | Modifiers
-------------+------------------------+-----------
n_nationkey | integer | not null
@ -595,10 +594,10 @@ HINT: You can enable two-phase commit for extra safety with: SET citus.multi_sh
n_regionkey | integer | not null
n_comment | character varying(152) |
new_col | integer |
(5 rows)
\c - - - :worker_1_port
\d test_schema_support.nation_hash_1190003;
Table "test_schema_support.nation_hash_1190003"
SELECT "Column", "Type", "Modifiers" FROM table_desc WHERE relid='test_schema_support.nation_hash_1190003'::regclass;
Column | Type | Modifiers
-------------+------------------------+-----------
n_nationkey | integer | not null
@ -606,6 +605,7 @@ HINT: You can enable two-phase commit for extra safety with: SET citus.multi_sh
n_regionkey | integer | not null
n_comment | character varying(152) |
new_col | integer |
(5 rows)
\c - - - :master_port
ALTER TABLE test_schema_support.nation_hash DROP COLUMN IF EXISTS non_existent_column;
@ -614,24 +614,24 @@ NOTICE: using one-phase commit for distributed DDL commands
HINT: You can enable two-phase commit for extra safety with: SET citus.multi_shard_commit_protocol TO '2pc'
ALTER TABLE test_schema_support.nation_hash DROP COLUMN IF EXISTS new_col;
-- verify column is dropped
\d test_schema_support.nation_hash;
Table "test_schema_support.nation_hash"
SELECT "Column", "Type", "Modifiers" FROM table_desc WHERE relid='test_schema_support.nation_hash'::regclass;
Column | Type | Modifiers
-------------+------------------------+-----------
n_nationkey | integer | not null
n_name | character(25) | not null
n_regionkey | integer | not null
n_comment | character varying(152) |
(4 rows)
\c - - - :worker_1_port
\d test_schema_support.nation_hash_1190003;
Table "test_schema_support.nation_hash_1190003"
SELECT "Column", "Type", "Modifiers" FROM table_desc WHERE relid='test_schema_support.nation_hash_1190003'::regclass;
Column | Type | Modifiers
-------------+------------------------+-----------
n_nationkey | integer | not null
n_name | character(25) | not null
n_regionkey | integer | not null
n_comment | character varying(152) |
(4 rows)
\c - - - :master_port
--test with search_path is set
@ -640,8 +640,7 @@ ALTER TABLE nation_hash ADD COLUMN new_col INT;
NOTICE: using one-phase commit for distributed DDL commands
HINT: You can enable two-phase commit for extra safety with: SET citus.multi_shard_commit_protocol TO '2pc'
-- verify column is added
\d test_schema_support.nation_hash;
Table "test_schema_support.nation_hash"
SELECT "Column", "Type", "Modifiers" FROM public.table_desc WHERE relid='test_schema_support.nation_hash'::regclass;
Column | Type | Modifiers
-------------+------------------------+-----------
n_nationkey | integer | not null
@ -649,10 +648,10 @@ HINT: You can enable two-phase commit for extra safety with: SET citus.multi_sh
n_regionkey | integer | not null
n_comment | character varying(152) |
new_col | integer |
(5 rows)
\c - - - :worker_1_port
\d test_schema_support.nation_hash_1190003;
Table "test_schema_support.nation_hash_1190003"
SELECT "Column", "Type", "Modifiers" FROM public.table_desc WHERE relid='test_schema_support.nation_hash_1190003'::regclass;
Column | Type | Modifiers
-------------+------------------------+-----------
n_nationkey | integer | not null
@ -660,6 +659,7 @@ HINT: You can enable two-phase commit for extra safety with: SET citus.multi_sh
n_regionkey | integer | not null
n_comment | character varying(152) |
new_col | integer |
(5 rows)
\c - - - :master_port
SET search_path TO test_schema_support;
@ -669,24 +669,24 @@ NOTICE: using one-phase commit for distributed DDL commands
HINT: You can enable two-phase commit for extra safety with: SET citus.multi_shard_commit_protocol TO '2pc'
ALTER TABLE nation_hash DROP COLUMN IF EXISTS new_col;
-- verify column is dropped
\d test_schema_support.nation_hash;
Table "test_schema_support.nation_hash"
SELECT "Column", "Type", "Modifiers" FROM public.table_desc WHERE relid='test_schema_support.nation_hash'::regclass;
Column | Type | Modifiers
-------------+------------------------+-----------
n_nationkey | integer | not null
n_name | character(25) | not null
n_regionkey | integer | not null
n_comment | character varying(152) |
(4 rows)
\c - - - :worker_1_port
\d test_schema_support.nation_hash_1190003;
Table "test_schema_support.nation_hash_1190003"
SELECT "Column", "Type", "Modifiers" FROM public.table_desc WHERE relid='test_schema_support.nation_hash_1190003'::regclass;
Column | Type | Modifiers
-------------+------------------------+-----------
n_nationkey | integer | not null
n_name | character(25) | not null
n_regionkey | integer | not null
n_comment | character varying(152) |
(4 rows)
\c - - - :master_port
-- test CREATE/DROP INDEX with schemas
@ -696,28 +696,20 @@ CREATE INDEX index1 ON test_schema_support.nation_hash(n_name);
NOTICE: using one-phase commit for distributed DDL commands
HINT: You can enable two-phase commit for extra safety with: SET citus.multi_shard_commit_protocol TO '2pc'
--verify INDEX is created
\d test_schema_support.nation_hash;
Table "test_schema_support.nation_hash"
Column | Type | Modifiers
-------------+------------------------+-----------
n_nationkey | integer | not null
n_name | character(25) | not null
n_regionkey | integer | not null
n_comment | character varying(152) |
Indexes:
"index1" btree (n_name)
\d test_schema_support.index1
Index "test_schema_support.index1"
Column | Type | Definition
--------+---------------+------------
n_name | character(25) | n_name
btree, for table "test_schema_support.nation_hash"
\c - - - :worker_1_port
\d test_schema_support.nation_hash_1190003;
Table "test_schema_support.nation_hash_1190003"
Column | Type | Modifiers
-------------+------------------------+-----------
n_nationkey | integer | not null
n_name | character(25) | not null
n_regionkey | integer | not null
n_comment | character varying(152) |
Indexes:
"index1_1190003" btree (n_name)
\d test_schema_support.index1_1190003
Index "test_schema_support.index1_1190003"
Column | Type | Definition
--------+---------------+------------
n_name | character(25) | n_name
btree, for table "test_schema_support.nation_hash_1190003"
\c - - - :master_port
-- DROP index
@ -725,25 +717,9 @@ DROP INDEX test_schema_support.index1;
NOTICE: using one-phase commit for distributed DDL commands
HINT: You can enable two-phase commit for extra safety with: SET citus.multi_shard_commit_protocol TO '2pc'
--verify INDEX is dropped
\d test_schema_support.nation_hash;
Table "test_schema_support.nation_hash"
Column | Type | Modifiers
-------------+------------------------+-----------
n_nationkey | integer | not null
n_name | character(25) | not null
n_regionkey | integer | not null
n_comment | character varying(152) |
\d test_schema_support.index1
\c - - - :worker_1_port
\d test_schema_support.nation_hash_1190003;
Table "test_schema_support.nation_hash_1190003"
Column | Type | Modifiers
-------------+------------------------+-----------
n_nationkey | integer | not null
n_name | character(25) | not null
n_regionkey | integer | not null
n_comment | character varying(152) |
\d test_schema_support.index1_1190003
\c - - - :master_port
--test with search_path is set
SET search_path TO test_schema_support;
@ -752,28 +728,20 @@ CREATE INDEX index1 ON nation_hash(n_name);
NOTICE: using one-phase commit for distributed DDL commands
HINT: You can enable two-phase commit for extra safety with: SET citus.multi_shard_commit_protocol TO '2pc'
--verify INDEX is created
\d test_schema_support.nation_hash;
Table "test_schema_support.nation_hash"
Column | Type | Modifiers
-------------+------------------------+-----------
n_nationkey | integer | not null
n_name | character(25) | not null
n_regionkey | integer | not null
n_comment | character varying(152) |
Indexes:
"index1" btree (n_name)
\d test_schema_support.index1
Index "test_schema_support.index1"
Column | Type | Definition
--------+---------------+------------
n_name | character(25) | n_name
btree, for table "test_schema_support.nation_hash"
\c - - - :worker_1_port
\d test_schema_support.nation_hash_1190003;
Table "test_schema_support.nation_hash_1190003"
Column | Type | Modifiers
-------------+------------------------+-----------
n_nationkey | integer | not null
n_name | character(25) | not null
n_regionkey | integer | not null
n_comment | character varying(152) |
Indexes:
"index1_1190003" btree (n_name)
\d test_schema_support.index1_1190003
Index "test_schema_support.index1_1190003"
Column | Type | Definition
--------+---------------+------------
n_name | character(25) | n_name
btree, for table "test_schema_support.nation_hash_1190003"
\c - - - :master_port
-- DROP index
@ -782,25 +750,9 @@ DROP INDEX index1;
NOTICE: using one-phase commit for distributed DDL commands
HINT: You can enable two-phase commit for extra safety with: SET citus.multi_shard_commit_protocol TO '2pc'
--verify INDEX is dropped
\d test_schema_support.nation_hash;
Table "test_schema_support.nation_hash"
Column | Type | Modifiers
-------------+------------------------+-----------
n_nationkey | integer | not null
n_name | character(25) | not null
n_regionkey | integer | not null
n_comment | character varying(152) |
\d test_schema_support.index1
\c - - - :worker_1_port
\d test_schema_support.nation_hash_1190003;
Table "test_schema_support.nation_hash_1190003"
Column | Type | Modifiers
-------------+------------------------+-----------
n_nationkey | integer | not null
n_name | character(25) | not null
n_regionkey | integer | not null
n_comment | character varying(152) |
\d test_schema_support.index1_1190003
\c - - - :master_port
-- test master_copy_shard_placement with schemas
SET search_path TO public;

View File

@ -420,18 +420,18 @@ SET search_path TO public;
ALTER TABLE test_schema_support.nation_hash ADD COLUMN new_col INT;
-- verify column is added
\d test_schema_support.nation_hash;
SELECT "Column", "Type", "Modifiers" FROM table_desc WHERE relid='test_schema_support.nation_hash'::regclass;
\c - - - :worker_1_port
\d test_schema_support.nation_hash_1190003;
SELECT "Column", "Type", "Modifiers" FROM table_desc WHERE relid='test_schema_support.nation_hash_1190003'::regclass;
\c - - - :master_port
ALTER TABLE test_schema_support.nation_hash DROP COLUMN IF EXISTS non_existent_column;
ALTER TABLE test_schema_support.nation_hash DROP COLUMN IF EXISTS new_col;
-- verify column is dropped
\d test_schema_support.nation_hash;
SELECT "Column", "Type", "Modifiers" FROM table_desc WHERE relid='test_schema_support.nation_hash'::regclass;
\c - - - :worker_1_port
\d test_schema_support.nation_hash_1190003;
SELECT "Column", "Type", "Modifiers" FROM table_desc WHERE relid='test_schema_support.nation_hash_1190003'::regclass;
\c - - - :master_port
--test with search_path is set
@ -439,9 +439,9 @@ SET search_path TO test_schema_support;
ALTER TABLE nation_hash ADD COLUMN new_col INT;
-- verify column is added
\d test_schema_support.nation_hash;
SELECT "Column", "Type", "Modifiers" FROM public.table_desc WHERE relid='test_schema_support.nation_hash'::regclass;
\c - - - :worker_1_port
\d test_schema_support.nation_hash_1190003;
SELECT "Column", "Type", "Modifiers" FROM public.table_desc WHERE relid='test_schema_support.nation_hash_1190003'::regclass;
\c - - - :master_port
SET search_path TO test_schema_support;
@ -449,9 +449,9 @@ ALTER TABLE nation_hash DROP COLUMN IF EXISTS non_existent_column;
ALTER TABLE nation_hash DROP COLUMN IF EXISTS new_col;
-- verify column is dropped
\d test_schema_support.nation_hash;
SELECT "Column", "Type", "Modifiers" FROM public.table_desc WHERE relid='test_schema_support.nation_hash'::regclass;
\c - - - :worker_1_port
\d test_schema_support.nation_hash_1190003;
SELECT "Column", "Type", "Modifiers" FROM public.table_desc WHERE relid='test_schema_support.nation_hash_1190003'::regclass;
\c - - - :master_port
@ -462,18 +462,18 @@ SET search_path TO public;
CREATE INDEX index1 ON test_schema_support.nation_hash(n_name);
--verify INDEX is created
\d test_schema_support.nation_hash;
\d test_schema_support.index1
\c - - - :worker_1_port
\d test_schema_support.nation_hash_1190003;
\d test_schema_support.index1_1190003
\c - - - :master_port
-- DROP index
DROP INDEX test_schema_support.index1;
--verify INDEX is dropped
\d test_schema_support.nation_hash;
\d test_schema_support.index1
\c - - - :worker_1_port
\d test_schema_support.nation_hash_1190003;
\d test_schema_support.index1_1190003
\c - - - :master_port
--test with search_path is set
@ -483,9 +483,9 @@ SET search_path TO test_schema_support;
CREATE INDEX index1 ON nation_hash(n_name);
--verify INDEX is created
\d test_schema_support.nation_hash;
\d test_schema_support.index1
\c - - - :worker_1_port
\d test_schema_support.nation_hash_1190003;
\d test_schema_support.index1_1190003
\c - - - :master_port
-- DROP index
@ -493,9 +493,9 @@ SET search_path TO test_schema_support;
DROP INDEX index1;
--verify INDEX is dropped
\d test_schema_support.nation_hash;
\d test_schema_support.index1
\c - - - :worker_1_port
\d test_schema_support.nation_hash_1190003;
\d test_schema_support.index1_1190003
\c - - - :master_port