index 391cd0d778d97b89dc5213d2118d8e8ed49fefe2..85534a3a7682e35336802034f885d403c4f1da82 100644 (file)
@@ -922,6 +922,10 @@ check_selective_binary_conversion(RelOptInfo *baserel,
/* Skip dropped attributes (probably shouldn't see any here). */
if (attr->attisdropped)
continue;
+ /* Skip generated columns (COPY won't accept them in the column
+ * list) */
+ if (attr->attgenerated)
+ continue;
*columns = lappend(*columns, makeString(pstrdup(attname)));
}
}
index a5e79a4549a5cedf5707fc11a6e08278f19c880d..45b728eeb3dfead53e1ecbdd00f0a816c6d86bf2 100644 (file)
SELECT tableoid::regclass, * FROM p2;
DROP TABLE pt;
+-- generated column tests
+CREATE FOREIGN TABLE gft1 (a int, b text, c text GENERATED ALWAYS AS ('foo') STORED) SERVER file_server
+OPTIONS (format 'csv', filename '@abs_srcdir@/data/list1.csv', delimiter ',');
+SELECT a, c FROM gft1;
+DROP FOREIGN TABLE gft1;
+
-- privilege tests
SET ROLE regress_file_fdw_superuser;
SELECT * FROM agg_text ORDER BY a;
index 853c9f9b28b53b816d7b89d66fcb8082c97bb415..52b4d5f1df7fcc5fe0d2f8b734aad8690a63a85f 100644 (file)
(3 rows)
DROP TABLE pt;
+-- generated column tests
+CREATE FOREIGN TABLE gft1 (a int, b text, c text GENERATED ALWAYS AS ('foo') STORED) SERVER file_server
+OPTIONS (format 'csv', filename '@abs_srcdir@/data/list1.csv', delimiter ',');
+SELECT a, c FROM gft1;
+ a | c
+---+--------
+ 1 | _null_
+ 1 | _null_
+(2 rows)
+
+DROP FOREIGN TABLE gft1;
-- privilege tests
SET ROLE regress_file_fdw_superuser;
SELECT * FROM agg_text ORDER BY a;