mirror of https://github.com/citusdata/citus.git
Merge 6e19d7ba5a
into 4cd8bb1b67
commit
20930644bf
|
@ -2060,8 +2060,12 @@ CitusCopyDestReceiverStartup(DestReceiver *dest, int operation,
|
||||||
|
|
||||||
UseCoordinatedTransaction();
|
UseCoordinatedTransaction();
|
||||||
|
|
||||||
/* all modifications use 2PC */
|
/* all modifications use 2PC unless we only touch a single shard */
|
||||||
Use2PCForCoordinatedTransaction();
|
if (!IsCitusTableTypeCacheEntry(cacheEntry, SINGLE_SHARD_DISTRIBUTED) &&
|
||||||
|
!IsCitusTableTypeCacheEntry(cacheEntry, CITUS_LOCAL_TABLE))
|
||||||
|
{
|
||||||
|
Use2PCForCoordinatedTransaction();
|
||||||
|
}
|
||||||
|
|
||||||
/* define how tuples will be serialised */
|
/* define how tuples will be serialised */
|
||||||
CopyOutState copyOutState = (CopyOutState) palloc0(sizeof(CopyOutStateData));
|
CopyOutState copyOutState = (CopyOutState) palloc0(sizeof(CopyOutStateData));
|
||||||
|
|
|
@ -38,9 +38,16 @@ SELECT partmethod, repmodel FROM pg_dist_partition WHERE logicalrelid = 'foreign
|
||||||
n | s
|
n | s
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
-- COPY FROM doesn't work for Citus foreign tables
|
-- COPY FROM for Citus foreign tables
|
||||||
COPY foreign_table FROM stdin;
|
COPY foreign_table FROM stdin;
|
||||||
ERROR: cannot PREPARE a transaction that has operated on postgres_fdw foreign tables
|
SELECT * FROM foreign_table ORDER BY a;
|
||||||
|
id | data | a
|
||||||
|
---------------------------------------------------------------------
|
||||||
|
1 | text_test | 1
|
||||||
|
1 | 1foo | 2
|
||||||
|
(2 rows)
|
||||||
|
|
||||||
|
DELETE FROM foreign_table WHERE a = 2;
|
||||||
CREATE TABLE parent_for_foreign_tables (
|
CREATE TABLE parent_for_foreign_tables (
|
||||||
project_id integer
|
project_id integer
|
||||||
) PARTITION BY HASH (project_id);
|
) PARTITION BY HASH (project_id);
|
||||||
|
|
|
@ -37,11 +37,14 @@ CREATE FOREIGN TABLE foreign_table (
|
||||||
--verify
|
--verify
|
||||||
SELECT partmethod, repmodel FROM pg_dist_partition WHERE logicalrelid = 'foreign_table'::regclass ORDER BY logicalrelid;
|
SELECT partmethod, repmodel FROM pg_dist_partition WHERE logicalrelid = 'foreign_table'::regclass ORDER BY logicalrelid;
|
||||||
|
|
||||||
-- COPY FROM doesn't work for Citus foreign tables
|
-- COPY FROM for Citus foreign tables
|
||||||
COPY foreign_table FROM stdin;
|
COPY foreign_table FROM stdin;
|
||||||
1 1foo 2
|
1 1foo 2
|
||||||
\.
|
\.
|
||||||
|
|
||||||
|
SELECT * FROM foreign_table ORDER BY a;
|
||||||
|
DELETE FROM foreign_table WHERE a = 2;
|
||||||
|
|
||||||
CREATE TABLE parent_for_foreign_tables (
|
CREATE TABLE parent_for_foreign_tables (
|
||||||
project_id integer
|
project_id integer
|
||||||
) PARTITION BY HASH (project_id);
|
) PARTITION BY HASH (project_id);
|
||||||
|
|
Loading…
Reference in New Issue