aboutsummaryrefslogtreecommitdiff
path: root/src/backend
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend')
-rw-r--r--src/backend/commands/copy.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/backend/commands/copy.c b/src/backend/commands/copy.c
index 4311e160076..faa3f6357ae 100644
--- a/src/backend/commands/copy.c
+++ b/src/backend/commands/copy.c
@@ -2397,10 +2397,15 @@ CopyFrom(CopyState cstate)
* possible to improve on this, but it does mean maintaining heap insert
* option flags per partition and setting them when we first open the
* partition.
+ *
+ * This optimization is not supported for relation types which do not
+ * have any physical storage, with foreign tables and views using
+ * INSTEAD OF triggers entering in this category. Partitioned tables
+ * are not supported as per the description above.
*----------
*/
/* createSubid is creation check, newRelfilenodeSubid is truncation check */
- if (cstate->rel->rd_rel->relkind != RELKIND_PARTITIONED_TABLE &&
+ if (RELKIND_CAN_HAVE_STORAGE(cstate->rel->rd_rel->relkind) &&
(cstate->rel->rd_createSubid != InvalidSubTransactionId ||
cstate->rel->rd_newRelfilenodeSubid != InvalidSubTransactionId))
{