Notice message to help truncate local data after distribution

pull/3752/head
Hanefi Önaldı 2020-04-17 13:20:30 +03:00
parent d535121f8d
commit 0c5d0cfee9
No known key found for this signature in database
GPG Key ID: 45A2ACB84E394FBA
37 changed files with 304 additions and 5 deletions

View File

@ -1340,6 +1340,18 @@ DoCopyFromLocalTableIntoShards(Relation distributedRelation,
ereport(DEBUG1, (errmsg("Copied " UINT64_FORMAT " rows", rowsCopied))); ereport(DEBUG1, (errmsg("Copied " UINT64_FORMAT " rows", rowsCopied)));
} }
if (rowsCopied > 0)
{
char *qualifiedRelationName =
generate_qualified_relation_name(RelationGetRelid(distributedRelation));
ereport(NOTICE, (errmsg("copying the data has completed"),
errdetail("The local data in the table is longer visible, "
"but is still on disk."),
errhint("To remove the local data, run: SELECT "
"truncate_local_data_after_distributing_table($$%s$$)",
qualifiedRelationName)));
}
MemoryContextSwitchTo(oldContext); MemoryContextSwitchTo(oldContext);
/* finish reading from the local table */ /* finish reading from the local table */

View File

@ -315,6 +315,9 @@ insert into stock VALUES
(32, 1, 1, 1, 1, 1, '', '','','','','','','','','',''); (32, 1, 1, 1, 1, 1, '', '','','','','','','','','','');
SELECT create_distributed_table('stock','s_w_id'); SELECT create_distributed_table('stock','s_w_id');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$ch_bench_having.stock$$)
create_distributed_table create_distributed_table
--------------------------------------------------------------------- ---------------------------------------------------------------------

View File

@ -323,6 +323,9 @@ insert into stock VALUES
(32, 1, 1, 1, 1, 1, '', '','','','','','','','','',''); (32, 1, 1, 1, 1, 1, '', '','','','','','','','','','');
SELECT create_distributed_table('stock','s_w_id'); SELECT create_distributed_table('stock','s_w_id');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$ch_bench_having.stock$$)
create_distributed_table create_distributed_table
--------------------------------------------------------------------- ---------------------------------------------------------------------

View File

@ -145,6 +145,9 @@ NOTICE: executing the command locally: SELECT worker_apply_shard_ddl_command (1
NOTICE: executing the copy locally for shard xxxxx NOTICE: executing the copy locally for shard xxxxx
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: executing the copy locally for shard xxxxx NOTICE: executing the copy locally for shard xxxxx
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$coordinator_shouldhaveshards.dist_table$$)
create_distributed_table create_distributed_table
--------------------------------------------------------------------- ---------------------------------------------------------------------
@ -178,6 +181,9 @@ NOTICE: executing the command locally: SELECT worker_apply_shard_ddl_command (1
NOTICE: executing the copy locally for shard xxxxx NOTICE: executing the copy locally for shard xxxxx
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: executing the copy locally for shard xxxxx NOTICE: executing the copy locally for shard xxxxx
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$coordinator_shouldhaveshards.dist_table$$)
create_distributed_table create_distributed_table
--------------------------------------------------------------------- ---------------------------------------------------------------------

View File

@ -4,6 +4,9 @@ CREATE TABLE tt1(id int, value_1 int);
INSERT INTO tt1 VALUES(1,2),(2,3),(3,4); INSERT INTO tt1 VALUES(1,2),(2,3),(3,4);
SELECT create_distributed_table('tt1','id'); SELECT create_distributed_table('tt1','id');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$cte_nested_modifications.tt1$$)
create_distributed_table create_distributed_table
--------------------------------------------------------------------- ---------------------------------------------------------------------
@ -13,6 +16,9 @@ CREATE TABLE tt2(id int, value_1 int);
INSERT INTO tt2 VALUES(3,3),(4,4),(5,5); INSERT INTO tt2 VALUES(3,3),(4,4),(5,5);
SELECT create_distributed_table('tt2','id'); SELECT create_distributed_table('tt2','id');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$cte_nested_modifications.tt2$$)
create_distributed_table create_distributed_table
--------------------------------------------------------------------- ---------------------------------------------------------------------

View File

@ -4,6 +4,9 @@ CREATE TABLE tt1(id int, value_1 int);
INSERT INTO tt1 VALUES(1,2),(2,3),(3,4); INSERT INTO tt1 VALUES(1,2),(2,3),(3,4);
SELECT create_distributed_table('tt1','id'); SELECT create_distributed_table('tt1','id');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$cte_prepared_modify.tt1$$)
create_distributed_table create_distributed_table
--------------------------------------------------------------------- ---------------------------------------------------------------------
@ -13,6 +16,9 @@ CREATE TABLE tt2(id int, value_1 int);
INSERT INTO tt2 VALUES(3,3),(4,4),(5,5); INSERT INTO tt2 VALUES(3,3),(4,4),(5,5);
SELECT create_distributed_table('tt2','id'); SELECT create_distributed_table('tt2','id');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$cte_prepared_modify.tt2$$)
create_distributed_table create_distributed_table
--------------------------------------------------------------------- ---------------------------------------------------------------------

View File

@ -35,6 +35,9 @@ CREATE TABLE test_propagate(id int, t1 text COLLATE german_phonebook,
INSERT INTO test_propagate VALUES (1, 'aesop', U&'\00E4sop'), (2, U&'Vo\1E9Er', 'Vossr'); INSERT INTO test_propagate VALUES (1, 'aesop', U&'\00E4sop'), (2, U&'Vo\1E9Er', 'Vossr');
SELECT create_distributed_table('test_propagate', 'id'); SELECT create_distributed_table('test_propagate', 'id');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$collation_tests.test_propagate$$)
create_distributed_table create_distributed_table
--------------------------------------------------------------------- ---------------------------------------------------------------------

View File

@ -13,6 +13,9 @@ INSERT INTO test VALUES
(2,2); (2,2);
SELECT create_reference_table('ref'); SELECT create_reference_table('ref');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$expression_reference_join.ref$$)
create_reference_table create_reference_table
--------------------------------------------------------------------- ---------------------------------------------------------------------
@ -20,6 +23,9 @@ NOTICE: Copying data from local table...
SELECT create_distributed_table('test', 'x'); SELECT create_distributed_table('test', 'x');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$expression_reference_join.test$$)
create_distributed_table create_distributed_table
--------------------------------------------------------------------- ---------------------------------------------------------------------

View File

@ -61,6 +61,9 @@ INSERT INTO r1 (id, name) VALUES
(3,'baz'); (3,'baz');
SELECT create_reference_table('r1'); SELECT create_reference_table('r1');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$fail_connect.r1$$)
create_reference_table create_reference_table
--------------------------------------------------------------------- ---------------------------------------------------------------------

View File

@ -227,6 +227,9 @@ SELECT citus.mitmproxy('conn.onCommandComplete(command="COPY").kill()');
SELECT create_distributed_table('test_table', 'id'); SELECT create_distributed_table('test_table', 'id');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$create_distributed_table_non_empty_failure.test_table$$)
ERROR: failed to COPY to shard xxxxx on localhost:xxxxx ERROR: failed to COPY to shard xxxxx on localhost:xxxxx
SELECT count(*) FROM pg_dist_shard WHERE logicalrelid='create_distributed_table_non_empty_failure.test_table'::regclass; SELECT count(*) FROM pg_dist_shard WHERE logicalrelid='create_distributed_table_non_empty_failure.test_table'::regclass;
count count
@ -259,6 +262,9 @@ SELECT citus.mitmproxy('conn.onCommandComplete(command="COPY").cancel(' || pg_b
SELECT create_distributed_table('test_table', 'id'); SELECT create_distributed_table('test_table', 'id');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$create_distributed_table_non_empty_failure.test_table$$)
ERROR: canceling statement due to user request ERROR: canceling statement due to user request
SELECT count(*) FROM pg_dist_shard WHERE logicalrelid='create_distributed_table_non_empty_failure.test_table'::regclass; SELECT count(*) FROM pg_dist_shard WHERE logicalrelid='create_distributed_table_non_empty_failure.test_table'::regclass;
count count

View File

@ -110,6 +110,9 @@ SELECT citus.mitmproxy('conn.onCommandComplete(command="COPY 3").kill()');
SELECT create_reference_table('ref_table'); SELECT create_reference_table('ref_table');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$failure_reference_table.ref_table$$)
ERROR: failed to COPY to shard xxxxx on localhost:xxxxx ERROR: failed to COPY to shard xxxxx on localhost:xxxxx
SELECT count(*) FROM pg_dist_shard_placement; SELECT count(*) FROM pg_dist_shard_placement;
count count
@ -126,6 +129,9 @@ SELECT citus.mitmproxy('conn.onCommandComplete(command="COPY 3").cancel(' || pg_
SELECT create_reference_table('ref_table'); SELECT create_reference_table('ref_table');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$failure_reference_table.ref_table$$)
ERROR: canceling statement due to user request ERROR: canceling statement due to user request
SELECT count(*) FROM pg_dist_shard_placement; SELECT count(*) FROM pg_dist_shard_placement;
count count
@ -215,6 +221,9 @@ SELECT citus.mitmproxy('conn.onQuery(query="^ROLLBACK").kill()');
BEGIN; BEGIN;
SELECT create_reference_table('ref_table'); SELECT create_reference_table('ref_table');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$failure_reference_table.ref_table$$)
create_reference_table create_reference_table
--------------------------------------------------------------------- ---------------------------------------------------------------------
@ -239,6 +248,9 @@ SELECT citus.mitmproxy('conn.onQuery(query="^ROLLBACK").cancel(' || pg_backend_p
BEGIN; BEGIN;
SELECT create_reference_table('ref_table'); SELECT create_reference_table('ref_table');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$failure_reference_table.ref_table$$)
create_reference_table create_reference_table
--------------------------------------------------------------------- ---------------------------------------------------------------------

View File

@ -436,6 +436,9 @@ SELECT citus.mitmproxy('conn.allow()');
CREATE TABLE t3 AS SELECT * FROM t2; CREATE TABLE t3 AS SELECT * FROM t2;
SELECT create_distributed_table('t3', 'a'); SELECT create_distributed_table('t3', 'a');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$multi_shard.t3$$)
create_distributed_table create_distributed_table
--------------------------------------------------------------------- ---------------------------------------------------------------------
@ -534,6 +537,9 @@ DROP TABLE t3;
CREATE TABLE t3 AS SELECT * FROM t2; CREATE TABLE t3 AS SELECT * FROM t2;
SELECT create_distributed_table('t3', 'a'); SELECT create_distributed_table('t3', 'a');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$multi_shard.t3$$)
create_distributed_table create_distributed_table
--------------------------------------------------------------------- ---------------------------------------------------------------------

View File

@ -1272,6 +1272,9 @@ BEGIN;
INSERT INTO test_table_2 SELECT i, i FROM generate_series(0,100) i; INSERT INTO test_table_2 SELECT i, i FROM generate_series(0,100) i;
SELECT create_reference_table('test_table_1'); SELECT create_reference_table('test_table_1');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$test_fkey_to_ref_in_tx.test_table_1$$)
create_reference_table create_reference_table
--------------------------------------------------------------------- ---------------------------------------------------------------------
@ -1296,6 +1299,9 @@ BEGIN;
INSERT INTO test_table_2 SELECT i, i FROM generate_series(0,100) i; INSERT INTO test_table_2 SELECT i, i FROM generate_series(0,100) i;
SELECT create_reference_table('test_table_1'); SELECT create_reference_table('test_table_1');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$test_fkey_to_ref_in_tx.test_table_1$$)
create_reference_table create_reference_table
--------------------------------------------------------------------- ---------------------------------------------------------------------

View File

@ -746,6 +746,9 @@ INSERT INTO referenced_table VALUES (1,1), (2,2), (3,3);
INSERT INTO referencing_table VALUES (1,1), (2,2), (3,3); INSERT INTO referencing_table VALUES (1,1), (2,2), (3,3);
SELECT create_reference_table('referenced_table'); SELECT create_reference_table('referenced_table');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$fkey_reference_table.referenced_table$$)
create_reference_table create_reference_table
--------------------------------------------------------------------- ---------------------------------------------------------------------
@ -1305,6 +1308,9 @@ BEGIN;
INSERT INTO test_table_2 SELECT i, i FROM generate_series(0,100) i; INSERT INTO test_table_2 SELECT i, i FROM generate_series(0,100) i;
SELECT create_reference_table('test_table_1'); SELECT create_reference_table('test_table_1');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$fkey_reference_table.test_table_1$$)
create_reference_table create_reference_table
--------------------------------------------------------------------- ---------------------------------------------------------------------

View File

@ -502,6 +502,9 @@ SELECT create_reference_table('ref_table');
NOTICE: executing the command locally: SELECT worker_apply_shard_ddl_command (1330000, 'local_shard_copy', 'CREATE TABLE local_shard_copy.ref_table (a integer)');SELECT worker_apply_shard_ddl_command (1330000, 'local_shard_copy', 'ALTER TABLE local_shard_copy.ref_table OWNER TO postgres') NOTICE: executing the command locally: SELECT worker_apply_shard_ddl_command (1330000, 'local_shard_copy', 'CREATE TABLE local_shard_copy.ref_table (a integer)');SELECT worker_apply_shard_ddl_command (1330000, 'local_shard_copy', 'ALTER TABLE local_shard_copy.ref_table OWNER TO postgres')
NOTICE: executing the copy locally for shard xxxxx NOTICE: executing the copy locally for shard xxxxx
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$local_shard_copy.ref_table$$)
create_reference_table create_reference_table
--------------------------------------------------------------------- ---------------------------------------------------------------------

View File

@ -698,7 +698,9 @@ INSERT INTO partitioning_test VALUES (6, '2012-07-07');
INSERT INTO partitioning_test VALUES (5, '2013-06-06'); INSERT INTO partitioning_test VALUES (5, '2013-06-06');
SELECT create_distributed_table('partitioning_test', 'id', colocate_with:='dist_table'); SELECT create_distributed_table('partitioning_test', 'id', colocate_with:='dist_table');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
create_distributed_table create_distributed_table
--------------------------------------------------------------------- ---------------------------------------------------------------------

View File

@ -138,6 +138,9 @@ FROM lineitem_local_to_hash_part, orders_local_to_hash_part, (SELECT SUM(l_exten
WHERE lineitem_local_to_hash_part.l_orderkey=orders_local_to_hash_part.o_orderkey; WHERE lineitem_local_to_hash_part.l_orderkey=orders_local_to_hash_part.o_orderkey;
SELECT create_distributed_table('lineitem_local_to_hash_part', 'l_orderkey'); SELECT create_distributed_table('lineitem_local_to_hash_part', 'l_orderkey');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$materialized_view.lineitem_local_to_hash_part$$)
create_distributed_table create_distributed_table
--------------------------------------------------------------------- ---------------------------------------------------------------------
@ -145,6 +148,9 @@ NOTICE: Copying data from local table...
SELECT create_distributed_table('orders_local_to_hash_part', 'o_orderkey'); SELECT create_distributed_table('orders_local_to_hash_part', 'o_orderkey');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$materialized_view.orders_local_to_hash_part$$)
create_distributed_table create_distributed_table
--------------------------------------------------------------------- ---------------------------------------------------------------------

View File

@ -89,7 +89,7 @@ ALTER TABLE products_append ADD CONSTRAINT p_key PRIMARY KEY(product_no);
WARNING: table "products_append" has a UNIQUE or EXCLUDE constraint WARNING: table "products_append" has a UNIQUE or EXCLUDE constraint
DETAIL: UNIQUE constraints, EXCLUDE constraints, and PRIMARY KEYs on append-partitioned tables cannot be enforced. DETAIL: UNIQUE constraints, EXCLUDE constraints, and PRIMARY KEYs on append-partitioned tables cannot be enforced.
HINT: Consider using hash partitioning. HINT: Consider using hash partitioning.
--- Error out since first and third rows have the same product_no --- Error out since first and third rows have the same product_no
\COPY products_append FROM STDIN DELIMITER AS ','; \COPY products_append FROM STDIN DELIMITER AS ',';
ERROR: duplicate key value violates unique constraint "p_key_1450033" ERROR: duplicate key value violates unique constraint "p_key_1450033"
DETAIL: Key (product_no)=(1) already exists. DETAIL: Key (product_no)=(1) already exists.
@ -176,8 +176,8 @@ ALTER TABLE unique_test_table_append ADD CONSTRAINT unn_id UNIQUE(id);
WARNING: table "unique_test_table_append" has a UNIQUE or EXCLUDE constraint WARNING: table "unique_test_table_append" has a UNIQUE or EXCLUDE constraint
DETAIL: UNIQUE constraints, EXCLUDE constraints, and PRIMARY KEYs on append-partitioned tables cannot be enforced. DETAIL: UNIQUE constraints, EXCLUDE constraints, and PRIMARY KEYs on append-partitioned tables cannot be enforced.
HINT: Consider using hash partitioning. HINT: Consider using hash partitioning.
-- Error out. Table can not have two rows with the same id. -- Error out. Table can not have two rows with the same id.
\COPY unique_test_table_append FROM STDIN DELIMITER AS ','; \COPY unique_test_table_append FROM STDIN DELIMITER AS ',';
ERROR: duplicate key value violates unique constraint "unn_id_1450067" ERROR: duplicate key value violates unique constraint "unn_id_1450067"
DETAIL: Key (id)=(X) already exists. DETAIL: Key (id)=(X) already exists.
DROP TABLE unique_test_table_append; DROP TABLE unique_test_table_append;
@ -336,7 +336,7 @@ ALTER TABLE products_append ADD CONSTRAINT exc_pno_name EXCLUDE USING btree (pro
WARNING: table "products_append" has a UNIQUE or EXCLUDE constraint WARNING: table "products_append" has a UNIQUE or EXCLUDE constraint
DETAIL: UNIQUE constraints, EXCLUDE constraints, and PRIMARY KEYs on append-partitioned tables cannot be enforced. DETAIL: UNIQUE constraints, EXCLUDE constraints, and PRIMARY KEYs on append-partitioned tables cannot be enforced.
HINT: Consider using hash partitioning. HINT: Consider using hash partitioning.
-- Error out since first and third can not pass the exclusion check. -- Error out since first and third can not pass the exclusion check.
\COPY products_append FROM STDIN DELIMITER AS ','; \COPY products_append FROM STDIN DELIMITER AS ',';
ERROR: conflicting key value violates exclusion constraint "exc_pno_name_1450135" ERROR: conflicting key value violates exclusion constraint "exc_pno_name_1450135"
DETAIL: Key (product_no, name)=(1, Product_1) conflicts with existing key (product_no, name)=(1, Product_1). DETAIL: Key (product_no, name)=(1, Product_1) conflicts with existing key (product_no, name)=(1, Product_1).
@ -560,6 +560,9 @@ INSERT INTO sc3.alter_add_prim_key(x) SELECT generate_series(1,100);
SET search_path TO 'sc3'; SET search_path TO 'sc3';
SELECT create_distributed_table('alter_add_prim_key', 'x'); SELECT create_distributed_table('alter_add_prim_key', 'x');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$sc3.alter_add_prim_key$$)
create_distributed_table create_distributed_table
--------------------------------------------------------------------- ---------------------------------------------------------------------

View File

@ -201,6 +201,9 @@ HINT: Empty your table before distributing it.
-- create_distributed_table creates shards and copies data into the distributed table -- create_distributed_table creates shards and copies data into the distributed table
SELECT create_distributed_table('data_load_test', 'col1'); SELECT create_distributed_table('data_load_test', 'col1');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$public.data_load_test$$)
create_distributed_table create_distributed_table
--------------------------------------------------------------------- ---------------------------------------------------------------------
@ -260,6 +263,9 @@ CREATE TABLE data_load_test (col1 int, col2 text, col3 serial);
INSERT INTO data_load_test VALUES (132, 'hello'); INSERT INTO data_load_test VALUES (132, 'hello');
SELECT create_distributed_table('data_load_test', 'col1'); SELECT create_distributed_table('data_load_test', 'col1');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$public.data_load_test$$)
create_distributed_table create_distributed_table
--------------------------------------------------------------------- ---------------------------------------------------------------------
@ -281,6 +287,9 @@ CREATE TABLE data_load_test1 (col1 int, col2 text, col3 serial);
INSERT INTO data_load_test1 VALUES (132, 'hello'); INSERT INTO data_load_test1 VALUES (132, 'hello');
SELECT create_distributed_table('data_load_test1', 'col1'); SELECT create_distributed_table('data_load_test1', 'col1');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$public.data_load_test1$$)
create_distributed_table create_distributed_table
--------------------------------------------------------------------- ---------------------------------------------------------------------
@ -290,6 +299,9 @@ CREATE TABLE data_load_test2 (col1 int, col2 text, col3 serial);
INSERT INTO data_load_test2 VALUES (132, 'world'); INSERT INTO data_load_test2 VALUES (132, 'world');
SELECT create_distributed_table('data_load_test2', 'col1'); SELECT create_distributed_table('data_load_test2', 'col1');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$public.data_load_test2$$)
create_distributed_table create_distributed_table
--------------------------------------------------------------------- ---------------------------------------------------------------------

View File

@ -237,6 +237,9 @@ CREATE TABLE data_load_test (col1 int, col2 text, col3 serial);
INSERT INTO data_load_test VALUES (132, 'hello'); INSERT INTO data_load_test VALUES (132, 'hello');
SELECT create_distributed_table('data_load_test', 'col1'); SELECT create_distributed_table('data_load_test', 'col1');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$public.data_load_test$$)
create_distributed_table create_distributed_table
--------------------------------------------------------------------- ---------------------------------------------------------------------
@ -251,6 +254,9 @@ CREATE TABLE data_load_test (col1 int, col2 text, col3 serial);
INSERT INTO data_load_test VALUES (132, 'hello'); INSERT INTO data_load_test VALUES (132, 'hello');
SELECT create_distributed_table('data_load_test', 'col1'); SELECT create_distributed_table('data_load_test', 'col1');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$public.data_load_test$$)
create_distributed_table create_distributed_table
--------------------------------------------------------------------- ---------------------------------------------------------------------
@ -264,6 +270,9 @@ CREATE TABLE data_load_test (col1 int, col2 text, col3 serial);
INSERT INTO data_load_test VALUES (132, 'hello'); INSERT INTO data_load_test VALUES (132, 'hello');
SELECT create_distributed_table('data_load_test', 'col1'); SELECT create_distributed_table('data_load_test', 'col1');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$public.data_load_test$$)
create_distributed_table create_distributed_table
--------------------------------------------------------------------- ---------------------------------------------------------------------
@ -279,6 +288,9 @@ INSERT INTO data_load_test VALUES (243, 'world', 'hello');
ALTER TABLE data_load_test DROP COLUMN col1; ALTER TABLE data_load_test DROP COLUMN col1;
SELECT create_distributed_table('data_load_test', 'col3'); SELECT create_distributed_table('data_load_test', 'col3');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$public.data_load_test$$)
create_distributed_table create_distributed_table
--------------------------------------------------------------------- ---------------------------------------------------------------------
@ -371,6 +383,9 @@ INSERT INTO rollback_table VALUES(2, 'Name_2');
INSERT INTO rollback_table VALUES(3, 'Name_3'); INSERT INTO rollback_table VALUES(3, 'Name_3');
SELECT create_distributed_table('rollback_table','id'); SELECT create_distributed_table('rollback_table','id');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$public.rollback_table$$)
create_distributed_table create_distributed_table
--------------------------------------------------------------------- ---------------------------------------------------------------------
@ -498,6 +513,9 @@ CREATE TABLE tt1(id int);
INSERT INTO tt1 VALUES(1); INSERT INTO tt1 VALUES(1);
SELECT create_distributed_table('tt1','id'); SELECT create_distributed_table('tt1','id');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$public.tt1$$)
create_distributed_table create_distributed_table
--------------------------------------------------------------------- ---------------------------------------------------------------------
@ -554,6 +572,9 @@ CREATE TABLE stage_table (LIKE sample_table);
\COPY stage_table FROM stdin; -- Note that this operation is a local copy \COPY stage_table FROM stdin; -- Note that this operation is a local copy
SELECT create_distributed_table('stage_table', 'id'); SELECT create_distributed_table('stage_table', 'id');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$public.stage_table$$)
create_distributed_table create_distributed_table
--------------------------------------------------------------------- ---------------------------------------------------------------------
@ -625,6 +646,9 @@ CREATE TABLE sc.ref(a int);
insert into sc.ref SELECT s FROM generate_series(0, 100) s; insert into sc.ref SELECT s FROM generate_series(0, 100) s;
SELECT create_reference_table('sc.ref'); SELECT create_reference_table('sc.ref');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$sc.ref$$)
create_reference_table create_reference_table
--------------------------------------------------------------------- ---------------------------------------------------------------------
@ -634,6 +658,9 @@ CREATE TABLE sc.hash(a int);
insert into sc.hash SELECT s FROM generate_series(0, 100) s; insert into sc.hash SELECT s FROM generate_series(0, 100) s;
SELECT create_distributed_table('sc.hash', 'a'); SELECT create_distributed_table('sc.hash', 'a');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$sc.hash$$)
create_distributed_table create_distributed_table
--------------------------------------------------------------------- ---------------------------------------------------------------------
@ -647,6 +674,9 @@ CREATE TABLE sc2.hash(a int);
insert into sc2.hash SELECT s FROM generate_series(0, 100) s; insert into sc2.hash SELECT s FROM generate_series(0, 100) s;
SELECT create_distributed_table('sc2.hash', 'a'); SELECT create_distributed_table('sc2.hash', 'a');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$sc2.hash$$)
create_distributed_table create_distributed_table
--------------------------------------------------------------------- ---------------------------------------------------------------------
@ -656,6 +686,9 @@ CREATE TABLE sc2.ref(a int);
insert into sc2.ref SELECT s FROM generate_series(0, 100) s; insert into sc2.ref SELECT s FROM generate_series(0, 100) s;
SELECT create_reference_table('sc2.ref'); SELECT create_reference_table('sc2.ref');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$sc2.ref$$)
create_reference_table create_reference_table
--------------------------------------------------------------------- ---------------------------------------------------------------------
@ -697,6 +730,9 @@ SET search_path = 'sc4';
ALTER TABLE alter_replica_table REPLICA IDENTITY USING INDEX alter_replica_table_pkey; ALTER TABLE alter_replica_table REPLICA IDENTITY USING INDEX alter_replica_table_pkey;
SELECT create_distributed_table('alter_replica_table', 'id'); SELECT create_distributed_table('alter_replica_table', 'id');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$sc4.alter_replica_table$$)
create_distributed_table create_distributed_table
--------------------------------------------------------------------- ---------------------------------------------------------------------
@ -722,6 +758,9 @@ INSERT INTO sc5.alter_replica_table(id) SELECT generate_series(1,100);
ALTER TABLE sc5.alter_replica_table REPLICA IDENTITY FULL; ALTER TABLE sc5.alter_replica_table REPLICA IDENTITY FULL;
SELECT create_distributed_table('sc5.alter_replica_table', 'id'); SELECT create_distributed_table('sc5.alter_replica_table', 'id');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$sc5.alter_replica_table$$)
create_distributed_table create_distributed_table
--------------------------------------------------------------------- ---------------------------------------------------------------------
@ -747,6 +786,9 @@ CREATE UNIQUE INDEX unique_idx ON sc6.alter_replica_table(id);
ALTER TABLE sc6.alter_replica_table REPLICA IDENTITY USING INDEX unique_idx; ALTER TABLE sc6.alter_replica_table REPLICA IDENTITY USING INDEX unique_idx;
SELECT create_distributed_table('sc6.alter_replica_table', 'id'); SELECT create_distributed_table('sc6.alter_replica_table', 'id');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$sc6.alter_replica_table$$)
create_distributed_table create_distributed_table
--------------------------------------------------------------------- ---------------------------------------------------------------------
@ -771,6 +813,9 @@ CREATE UNIQUE INDEX unique_idx ON alter_replica_table(id);
ALTER TABLE alter_replica_table REPLICA IDENTITY USING INDEX unique_idx; ALTER TABLE alter_replica_table REPLICA IDENTITY USING INDEX unique_idx;
SELECT create_distributed_table('alter_replica_table', 'id'); SELECT create_distributed_table('alter_replica_table', 'id');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$public.alter_replica_table$$)
create_distributed_table create_distributed_table
--------------------------------------------------------------------- ---------------------------------------------------------------------

View File

@ -378,6 +378,9 @@ INSERT INTO my_table_with_data VALUES (1,2);
RESET ROLE; RESET ROLE;
SELECT create_distributed_table('my_table_with_data', 'id'); SELECT create_distributed_table('my_table_with_data', 'id');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$public.my_table_with_data$$)
create_distributed_table create_distributed_table
--------------------------------------------------------------------- ---------------------------------------------------------------------
@ -405,6 +408,9 @@ RESET ROLE;
SET ROLE read_access; SET ROLE read_access;
SELECT create_distributed_table('my_role_table_with_data', 'id'); SELECT create_distributed_table('my_role_table_with_data', 'id');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$public.my_role_table_with_data$$)
create_distributed_table create_distributed_table
--------------------------------------------------------------------- ---------------------------------------------------------------------
@ -561,6 +567,9 @@ RESET ROLE;
-- now we distribute the table as super user -- now we distribute the table as super user
SELECT create_distributed_table('full_access_user_schema.t1', 'id'); SELECT create_distributed_table('full_access_user_schema.t1', 'id');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$full_access_user_schema.t1$$)
create_distributed_table create_distributed_table
--------------------------------------------------------------------- ---------------------------------------------------------------------

View File

@ -26,7 +26,13 @@ INSERT INTO partitioning_test_2010 VALUES (4, '2010-03-03');
-- distribute partitioned table -- distribute partitioned table
SELECT create_distributed_table('partitioning_test', 'id'); SELECT create_distributed_table('partitioning_test', 'id');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$public.partitioning_test_2009$$)
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$public.partitioning_test_2010$$)
create_distributed_table create_distributed_table
--------------------------------------------------------------------- ---------------------------------------------------------------------
@ -134,6 +140,9 @@ INSERT INTO partitioning_test_2012 VALUES (5, '2012-06-06');
INSERT INTO partitioning_test_2012 VALUES (6, '2012-07-07'); INSERT INTO partitioning_test_2012 VALUES (6, '2012-07-07');
ALTER TABLE partitioning_test ATTACH PARTITION partitioning_test_2012 FOR VALUES FROM ('2012-01-01') TO ('2013-01-01'); ALTER TABLE partitioning_test ATTACH PARTITION partitioning_test_2012 FOR VALUES FROM ('2012-01-01') TO ('2013-01-01');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$public.partitioning_test_2012$$)
-- see from MX node, attached partition is distributed as well -- see from MX node, attached partition is distributed as well
\c - - - :worker_1_port \c - - - :worker_1_port
SELECT SELECT

View File

@ -28,7 +28,13 @@ INSERT INTO partitioning_hash_test VALUES (4, 4);
-- distribute partitioned table -- distribute partitioned table
SELECT create_distributed_table('partitioning_test', 'id'); SELECT create_distributed_table('partitioning_test', 'id');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$public.partitioning_test_2009$$)
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$public.partitioning_test_2010$$)
create_distributed_table create_distributed_table
--------------------------------------------------------------------- ---------------------------------------------------------------------
@ -36,7 +42,13 @@ NOTICE: Copying data from local table...
SELECT create_distributed_table('partitioning_hash_test', 'id'); SELECT create_distributed_table('partitioning_hash_test', 'id');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$public.partitioning_hash_test_0$$)
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$public.partitioning_hash_test_1$$)
create_distributed_table create_distributed_table
--------------------------------------------------------------------- ---------------------------------------------------------------------
@ -157,6 +169,9 @@ INSERT INTO partitioning_test_2012 VALUES (5, '2012-06-06');
INSERT INTO partitioning_test_2012 VALUES (6, '2012-07-07'); INSERT INTO partitioning_test_2012 VALUES (6, '2012-07-07');
ALTER TABLE partitioning_test ATTACH PARTITION partitioning_test_2012 FOR VALUES FROM ('2012-01-01') TO ('2013-01-01'); ALTER TABLE partitioning_test ATTACH PARTITION partitioning_test_2012 FOR VALUES FROM ('2012-01-01') TO ('2013-01-01');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$public.partitioning_test_2012$$)
-- attached partition is distributed as well -- attached partition is distributed as well
SELECT SELECT
logicalrelid logicalrelid
@ -199,6 +214,9 @@ CREATE TABLE partitioning_hash_test_2 (id int, subid int);
INSERT INTO partitioning_hash_test_2 VALUES (8, 5); INSERT INTO partitioning_hash_test_2 VALUES (8, 5);
ALTER TABLE partitioning_hash_test ATTACH PARTITION partitioning_hash_test_2 FOR VALUES WITH (MODULUS 3, REMAINDER 2); ALTER TABLE partitioning_hash_test ATTACH PARTITION partitioning_hash_test_2 FOR VALUES WITH (MODULUS 3, REMAINDER 2);
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$public.partitioning_hash_test_2$$)
INSERT INTO partitioning_hash_test VALUES (9, 12); INSERT INTO partitioning_hash_test VALUES (9, 12);
-- see the data is loaded to shards -- see the data is loaded to shards
SELECT * FROM partitioning_test ORDER BY 1; SELECT * FROM partitioning_test ORDER BY 1;
@ -412,7 +430,7 @@ SELECT * FROM partitioning_test WHERE id = 9 OR id = 10 ORDER BY 1;
-- create default partition -- create default partition
CREATE TABLE partitioning_test_default PARTITION OF partitioning_test DEFAULT; CREATE TABLE partitioning_test_default PARTITION OF partitioning_test DEFAULT;
\d+ partitioning_test \d+ partitioning_test
Table "public.partitioning_test" Table "public.partitioning_test"
Column | Type | Collation | Nullable | Default | Storage | Stats target | Description Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
--------------------------------------------------------------------- ---------------------------------------------------------------------
id | integer | | | | plain | | id | integer | | | | plain | |
@ -692,6 +710,9 @@ CREATE TABLE partitioning_test_reference(id int PRIMARY KEY, subid int);
INSERT INTO partitioning_test_reference SELECT a, a FROM generate_series(1, 50) a; INSERT INTO partitioning_test_reference SELECT a, a FROM generate_series(1, 50) a;
SELECT create_reference_table('partitioning_test_reference'); SELECT create_reference_table('partitioning_test_reference');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$public.partitioning_test_reference$$)
create_reference_table create_reference_table
--------------------------------------------------------------------- ---------------------------------------------------------------------

View File

@ -207,7 +207,13 @@ INSERT INTO partitioning_test VALUES (1, '2009-06-06');
INSERT INTO partitioning_test VALUES (2, '2010-07-07'); INSERT INTO partitioning_test VALUES (2, '2010-07-07');
SELECT create_distributed_table('partitioning_test', 'id'); SELECT create_distributed_table('partitioning_test', 'id');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$multi_real_time_transaction.partitioning_test_2009$$)
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$multi_real_time_transaction.partitioning_test_2010$$)
create_distributed_table create_distributed_table
--------------------------------------------------------------------- ---------------------------------------------------------------------

View File

@ -5,6 +5,9 @@ INSERT INTO reference_table_test VALUES (1, 1.0, '1', '2016-12-01');
-- create the reference table -- create the reference table
SELECT create_reference_table('reference_table_test'); SELECT create_reference_table('reference_table_test');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$public.reference_table_test$$)
create_reference_table create_reference_table
--------------------------------------------------------------------- ---------------------------------------------------------------------

View File

@ -227,6 +227,9 @@ CREATE TABLE tt1_1120 partition of tt1 for VALUES FROM (11) to (20);
INSERT INTO tt1 VALUES (1,11), (3,15), (5,17), (6,19), (8,17), (2,12); INSERT INTO tt1 VALUES (1,11), (3,15), (5,17), (6,19), (8,17), (2,12);
SELECT create_distributed_table('tt1','id'); SELECT create_distributed_table('tt1','id');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$public.tt1_1120$$)
create_distributed_table create_distributed_table
--------------------------------------------------------------------- ---------------------------------------------------------------------
@ -341,6 +344,9 @@ INSERT INTO test_table_1 VALUES(2, '2015-02-01 08:31:16', 7);
INSERT INTO test_table_1 VALUES(3, '2111-01-12 08:35:19', 9); INSERT INTO test_table_1 VALUES(3, '2111-01-12 08:35:19', 9);
SELECT create_distributed_table('test_table_1', 'id'); SELECT create_distributed_table('test_table_1', 'id');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$public.test_table_1$$)
create_distributed_table create_distributed_table
--------------------------------------------------------------------- ---------------------------------------------------------------------
@ -793,6 +799,9 @@ INSERT INTO test_table_2 VALUES(2, random());
INSERT INTO test_table_2 VALUES(3, random()); INSERT INTO test_table_2 VALUES(3, random());
SELECT create_distributed_table('test_table_2', 'id'); SELECT create_distributed_table('test_table_2', 'id');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$public.test_table_2$$)
create_distributed_table create_distributed_table
--------------------------------------------------------------------- ---------------------------------------------------------------------

View File

@ -307,6 +307,9 @@ CREATE TABLE test_local_truncate (x int, y int);
INSERT INTO test_local_truncate VALUES (1,2); INSERT INTO test_local_truncate VALUES (1,2);
SELECT create_distributed_table('test_local_truncate', 'x', colocate_with => 'none'); SELECT create_distributed_table('test_local_truncate', 'x', colocate_with => 'none');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$multi_truncate.test_local_truncate$$)
create_distributed_table create_distributed_table
--------------------------------------------------------------------- ---------------------------------------------------------------------
@ -343,6 +346,9 @@ CREATE TABLE test_local_truncate (x int, y int);
INSERT INTO test_local_truncate VALUES (1,2); INSERT INTO test_local_truncate VALUES (1,2);
SELECT create_distributed_table('test_local_truncate', 'x', colocate_with => 'none'); SELECT create_distributed_table('test_local_truncate', 'x', colocate_with => 'none');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$multi_truncate.test_local_truncate$$)
create_distributed_table create_distributed_table
--------------------------------------------------------------------- ---------------------------------------------------------------------
@ -388,6 +394,9 @@ DETAIL: This UDF only truncates local records of distributed tables.
-- We can not truncate local tables until all the local foreign keys are removed. -- We can not truncate local tables until all the local foreign keys are removed.
SELECT create_distributed_table('referenced_table', 'id'); SELECT create_distributed_table('referenced_table', 'id');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$multi_truncate.referenced_table$$)
create_distributed_table create_distributed_table
--------------------------------------------------------------------- ---------------------------------------------------------------------
@ -400,6 +409,9 @@ DETAIL: Table "referencing_table" references "referenced_table"
-- Test foreign keys between distributed tables -- Test foreign keys between distributed tables
SELECT create_distributed_table('referencing_table', 'ref_id'); SELECT create_distributed_table('referencing_table', 'ref_id');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$multi_truncate.referencing_table$$)
create_distributed_table create_distributed_table
--------------------------------------------------------------------- ---------------------------------------------------------------------
@ -472,6 +484,9 @@ CREATE TABLE ref(id int UNIQUE, data int);
INSERT INTO ref SELECT x,x FROM generate_series(1,10000) x; INSERT INTO ref SELECT x,x FROM generate_series(1,10000) x;
SELECT create_reference_table('ref'); SELECT create_reference_table('ref');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$multi_truncate.ref$$)
create_reference_table create_reference_table
--------------------------------------------------------------------- ---------------------------------------------------------------------
@ -509,6 +524,9 @@ CREATE TABLE t1(a int, b int);
INSERT INTO t1 VALUES(1,1); INSERT INTO t1 VALUES(1,1);
SELECT create_distributed_table('t1', 'a'); SELECT create_distributed_table('t1', 'a');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$multi_truncate.t1$$)
create_distributed_table create_distributed_table
--------------------------------------------------------------------- ---------------------------------------------------------------------

View File

@ -36,6 +36,9 @@ insert into gen1 (id, val1) values (1,4),(3,6),(5,2),(7,2);
insert into gen2 (id, val1) values (1,4),(3,6),(5,2),(7,2); insert into gen2 (id, val1) values (1,4),(3,6),(5,2),(7,2);
select create_distributed_table('gen1', 'id'); select create_distributed_table('gen1', 'id');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$test_pg12.gen1$$)
create_distributed_table create_distributed_table
--------------------------------------------------------------------- ---------------------------------------------------------------------
@ -267,6 +270,9 @@ ERROR: insert or update on table "collection_users" violates foreign key constr
DETAIL: Key (key, collection_id)=(1, 1000) is not present in table "collections_list". DETAIL: Key (key, collection_id)=(1, 1000) is not present in table "collections_list".
SELECT create_distributed_table('collections_list', 'key'); SELECT create_distributed_table('collections_list', 'key');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$test_pg12.collections_list_0$$)
create_distributed_table create_distributed_table
--------------------------------------------------------------------- ---------------------------------------------------------------------
@ -274,6 +280,9 @@ NOTICE: Copying data from local table...
SELECT create_distributed_table('collection_users', 'key'); SELECT create_distributed_table('collection_users', 'key');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$test_pg12.collection_users$$)
create_distributed_table create_distributed_table
--------------------------------------------------------------------- ---------------------------------------------------------------------
@ -292,6 +301,9 @@ CREATE TABLE test (x int, y int);
INSERT INTO test (x,y) SELECT i,i*3 from generate_series(1, 100) i; INSERT INTO test (x,y) SELECT i,i*3 from generate_series(1, 100) i;
SELECT create_distributed_table('test', 'x'); SELECT create_distributed_table('test', 'x');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$test_pg12.test$$)
create_distributed_table create_distributed_table
--------------------------------------------------------------------- ---------------------------------------------------------------------
@ -379,6 +391,9 @@ select create_distributed_table('col_test', 'val');
ERROR: Hash distributed partition columns may not use a non deterministic collation ERROR: Hash distributed partition columns may not use a non deterministic collation
select create_distributed_table('col_test', 'id'); select create_distributed_table('col_test', 'id');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$test_pg12.col_test$$)
create_distributed_table create_distributed_table
--------------------------------------------------------------------- ---------------------------------------------------------------------

View File

@ -58,6 +58,9 @@ drop cascades to table "weird.table"
-- redistribute the schema -- redistribute the schema
SELECT create_distributed_table('data', 'key'); SELECT create_distributed_table('data', 'key');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$dumper.data$$)
create_distributed_table create_distributed_table
--------------------------------------------------------------------- ---------------------------------------------------------------------
@ -65,6 +68,9 @@ NOTICE: Copying data from local table...
SELECT create_distributed_table('"weird.table"', 'key,'); SELECT create_distributed_table('"weird.table"', 'key,');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$dumper."weird.table"$$)
create_distributed_table create_distributed_table
--------------------------------------------------------------------- ---------------------------------------------------------------------

View File

@ -971,6 +971,9 @@ INSERT INTO table_3 SELECT i, i FROM generate_series(0,100) i;
BEGIN; BEGIN;
SELECT create_distributed_table('table_3', 'key'); SELECT create_distributed_table('table_3', 'key');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$access_tracking.table_3$$)
create_distributed_table create_distributed_table
--------------------------------------------------------------------- ---------------------------------------------------------------------

View File

@ -27,7 +27,13 @@ INSERT INTO collections (key, ts, collection_id, value) VALUES (4, '2009-01-01',
-- already existing partitioninong hierarcy -- already existing partitioninong hierarcy
SELECT create_distributed_table('collections', 'key'); SELECT create_distributed_table('collections', 'key');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$partitioned_table_replicated.collections_1$$)
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$partitioned_table_replicated.collections_2$$)
create_distributed_table create_distributed_table
--------------------------------------------------------------------- ---------------------------------------------------------------------
@ -41,6 +47,9 @@ CREATE TABLE collections_4 AS SELECT * FROM collections LIMIT 0;
INSERT INTO collections_4 SELECT i, '2009-01-01', 4, i FROM generate_series (0, 10) i; INSERT INTO collections_4 SELECT i, '2009-01-01', 4, i FROM generate_series (0, 10) i;
ALTER TABLE collections ATTACH PARTITION collections_4 FOR VALUES IN ( 4 ); ALTER TABLE collections ATTACH PARTITION collections_4 FOR VALUES IN ( 4 );
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$partitioned_table_replicated.collections_4$$)
-- finally attach a distributed table to a distributed table -- finally attach a distributed table to a distributed table
CREATE TABLE collections_5 AS SELECT * FROM collections LIMIT 0; CREATE TABLE collections_5 AS SELECT * FROM collections LIMIT 0;
SELECT create_distributed_table('collections_5', 'key'); SELECT create_distributed_table('collections_5', 'key');

View File

@ -293,6 +293,9 @@ CREATE TABLE test_seq_truncate (a int);
INSERT INTO test_seq_truncate SELECT i FROM generate_series(0, 100) i; INSERT INTO test_seq_truncate SELECT i FROM generate_series(0, 100) i;
SELECT create_distributed_table('test_seq_truncate', 'a'); SELECT create_distributed_table('test_seq_truncate', 'a');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$test_seq_ddl.test_seq_truncate$$)
create_distributed_table create_distributed_table
--------------------------------------------------------------------- ---------------------------------------------------------------------

View File

@ -18,7 +18,13 @@ INSERT INTO partitioning_test_2010 VALUES (4, 4, '2010-03-03');
SET citus.shard_replication_factor TO 1; SET citus.shard_replication_factor TO 1;
SELECT create_distributed_table('partitioning_test', 'id'); SELECT create_distributed_table('partitioning_test', 'id');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$subquery_and_partitioning.partitioning_test_2010$$)
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$subquery_and_partitioning.partitioning_test_2017$$)
create_distributed_table create_distributed_table
--------------------------------------------------------------------- ---------------------------------------------------------------------

View File

@ -207,6 +207,9 @@ SELECT * FROM t2 ORDER BY a;
SELECT create_distributed_table('t2', 'a'); SELECT create_distributed_table('t2', 'a');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$upgrade_basic.t2$$)
create_distributed_table create_distributed_table
--------------------------------------------------------------------- ---------------------------------------------------------------------

View File

@ -15,7 +15,13 @@ INSERT INTO partitioning_test_2010 VALUES (4, '2010-03-03');
-- distribute partitioned table -- distribute partitioned table
SELECT create_distributed_table('with_partitioning.partitioning_test', 'id'); SELECT create_distributed_table('with_partitioning.partitioning_test', 'id');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$with_partitioning.partitioning_test_2010$$)
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$with_partitioning.partitioning_test_2017$$)
create_distributed_table create_distributed_table
--------------------------------------------------------------------- ---------------------------------------------------------------------

View File

@ -205,6 +205,9 @@ CREATE TABLE impressions (
\copy impressions from '@abs_srcdir@/data/impressions.csv' with csv \copy impressions from '@abs_srcdir@/data/impressions.csv' with csv
SELECT create_distributed_table('companies', 'id'); SELECT create_distributed_table('companies', 'id');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$public.companies$$)
create_distributed_table create_distributed_table
-------------------------- --------------------------
@ -212,6 +215,9 @@ NOTICE: Copying data from local table...
SELECT create_distributed_table('campaigns', 'company_id'); SELECT create_distributed_table('campaigns', 'company_id');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$public.campaigns$$)
create_distributed_table create_distributed_table
-------------------------- --------------------------
@ -219,6 +225,9 @@ NOTICE: Copying data from local table...
SELECT create_distributed_table('ads', 'company_id'); SELECT create_distributed_table('ads', 'company_id');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$public.ads$$)
create_distributed_table create_distributed_table
-------------------------- --------------------------
@ -226,6 +235,9 @@ NOTICE: Copying data from local table...
SELECT create_distributed_table('clicks', 'company_id'); SELECT create_distributed_table('clicks', 'company_id');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$public.clicks$$)
create_distributed_table create_distributed_table
-------------------------- --------------------------
@ -233,6 +245,9 @@ NOTICE: Copying data from local table...
SELECT create_distributed_table('impressions', 'company_id'); SELECT create_distributed_table('impressions', 'company_id');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$public.impressions$$)
create_distributed_table create_distributed_table
-------------------------- --------------------------

View File

@ -988,6 +988,9 @@ CREATE UNLOGGED TABLE trigger_flush AS
SELECT 1 AS a, s AS b, s AS c, s AS d, s AS e, s AS f, s AS g, s AS h FROM generate_series(1,150000) s; SELECT 1 AS a, s AS b, s AS c, s AS d, s AS e, s AS f, s AS g, s AS h FROM generate_series(1,150000) s;
SELECT create_distributed_table('trigger_flush','a'); SELECT create_distributed_table('trigger_flush','a');
NOTICE: Copying data from local table... NOTICE: Copying data from local table...
NOTICE: copying the data has completed
DETAIL: The local data in the table is longer visible, but is still on disk.
HINT: To remove the local data, run: SELECT truncate_local_data_after_distributing_table($$public.trigger_flush$$)
create_distributed_table create_distributed_table
-------------------------- --------------------------