mirror of https://github.com/citusdata/citus.git
38 lines
1.2 KiB
Plaintext
38 lines
1.2 KiB
Plaintext
-- check that we properly retained the single-shard table
|
|
SELECT 1 FROM pg_dist_partition
|
|
WHERE logicalrelid = 'citus_schema.null_shard_key'::regclass AND
|
|
partmethod = 'n' AND repmodel = 's' AND colocationid != 0;
|
|
?column?
|
|
---------------------------------------------------------------------
|
|
1
|
|
(1 row)
|
|
|
|
BEGIN;
|
|
INSERT INTO citus_schema.null_shard_key (name) VALUES ('c');
|
|
SELECT * FROM citus_schema.null_shard_key ORDER BY id;
|
|
id | name
|
|
---------------------------------------------------------------------
|
|
1 | a
|
|
2 | b
|
|
| c
|
|
(3 rows)
|
|
|
|
ROLLBACK;
|
|
-- Check that we can create a distributed table with a single-shard
|
|
-- after upgrade.
|
|
CREATE TABLE citus_schema.null_shard_key_after_upgrade (id bigserial, name text);
|
|
SELECT create_distributed_table('citus_schema.null_shard_key_after_upgrade', null);
|
|
create_distributed_table
|
|
---------------------------------------------------------------------
|
|
|
|
(1 row)
|
|
|
|
INSERT INTO citus_schema.null_shard_key_after_upgrade (name) VALUES ('c');
|
|
SELECT * FROM citus_schema.null_shard_key_after_upgrade ORDER BY id;
|
|
id | name
|
|
---------------------------------------------------------------------
|
|
1 | c
|
|
(1 row)
|
|
|
|
DROP TABLE citus_schema.null_shard_key_after_upgrade;
|