From c09c128cdf7d12a7837a880b362304f4712b0adc Mon Sep 17 00:00:00 2001 From: Naisila Puka <37271756+naisila@users.noreply.github.com> Date: Fri, 1 Sep 2023 12:20:07 +0300 Subject: [PATCH] Adds test for COPY FROM failure in Citus foreign tables (#7160) --- src/test/regress/expected/foreign_tables_mx.out | 3 +++ src/test/regress/sql/foreign_tables_mx.sql | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/src/test/regress/expected/foreign_tables_mx.out b/src/test/regress/expected/foreign_tables_mx.out index 4bcddac5a..f9f63806b 100644 --- a/src/test/regress/expected/foreign_tables_mx.out +++ b/src/test/regress/expected/foreign_tables_mx.out @@ -38,6 +38,9 @@ SELECT partmethod, repmodel FROM pg_dist_partition WHERE logicalrelid = 'foreign n | s (1 row) +-- COPY FROM doesn't work for Citus foreign tables +COPY foreign_table FROM stdin; +ERROR: cannot PREPARE a transaction that has operated on postgres_fdw foreign tables CREATE TABLE parent_for_foreign_tables ( project_id integer ) PARTITION BY HASH (project_id); diff --git a/src/test/regress/sql/foreign_tables_mx.sql b/src/test/regress/sql/foreign_tables_mx.sql index eec5b7316..bdef5a4c5 100644 --- a/src/test/regress/sql/foreign_tables_mx.sql +++ b/src/test/regress/sql/foreign_tables_mx.sql @@ -37,6 +37,11 @@ CREATE FOREIGN TABLE foreign_table ( --verify 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 foreign_table FROM stdin; +1 1foo 2 +\. + CREATE TABLE parent_for_foreign_tables ( project_id integer ) PARTITION BY HASH (project_id);