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

Commit29ab1e2

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 parentc00c4c5 commit29ab1e2

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
@@ -2744,7 +2744,8 @@ CopyFrom(CopyState cstate)
27442744
check_partition_constr= false;
27452745

27462746
/* Check the constraints of the tuple */
2747-
if (cstate->rel->rd_att->constr||check_partition_constr)
2747+
if (resultRelInfo->ri_RelationDesc->rd_att->constr||
2748+
check_partition_constr)
27482749
ExecConstraints(resultRelInfo,slot,estate);
27492750

27502751
if (useHeapMultiInsert)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp