Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitcfbecf8

Browse files
committed
Enforce child constraints during COPY TO a partitioned table.
The previous coding inadvertently checked the constraints for thepartitioned table rather than the target partition, which couldlead to data in a partition that fails to satisfy some constrainton that partition. This problem seems to date back to whentable partitioning was introduced; prior to that, there was onlyone target table for a COPY, so the problem didn't occur, and thecode just didn't get updated.Etsuro Fujita, reviewed by Amit Langote and Ashutosh BapatDiscussion:https://postgr.es/message-id/5ABA4074.1090500%40lab.ntt.co.jp
1 parent870d896 commitcfbecf8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

‎src/backend/commands/copy.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2709,7 +2709,8 @@ CopyFrom(CopyState cstate)
27092709
check_partition_constr= false;
27102710

27112711
/* Check the constraints of the tuple */
2712-
if (cstate->rel->rd_att->constr||check_partition_constr)
2712+
if (resultRelInfo->ri_RelationDesc->rd_att->constr||
2713+
check_partition_constr)
27132714
ExecConstraints(resultRelInfo,slot,estate, true);
27142715

27152716
if (useHeapMultiInsert)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp