Skip to content

Commit d7fd9b9

Browse files
committed
don't allow freeze for COPY FROM on partitioned table
1 parent 8e24c01 commit d7fd9b9

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/copy_stmt_hooking.c

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,21 @@ is_pathman_related_copy(Node *parsetree)
7373
/* Check that relation is partitioned */
7474
if (get_pathman_relation_info(partitioned_table))
7575
{
76-
elog(DEBUG1, "Overriding default behavior for COPY (%u)", partitioned_table);
76+
ListCell *lc;
77+
78+
/* Analyze options list */
79+
foreach (lc, copy_stmt->options)
80+
{
81+
DefElem *defel = (DefElem *) lfirst(lc);
82+
83+
Assert(IsA(defel, DefElem));
84+
85+
/* We do not support freeze */
86+
if (strcmp(defel->defname, "freeze") == 0)
87+
elog(ERROR, "freeze is not supported for partitioned tables");
88+
}
89+
90+
elog(DEBUG1, "Overriding default behavior for COPY [%u]", partitioned_table);
7791
return true;
7892
}
7993

0 commit comments

Comments
 (0)