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

Commit431b316

Browse files
committed
PG 11: check moved rows in router_lock_or_delete_tuple()
1 parent45e040a commit431b316

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

‎src/include/compat/pg_compat.h‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,16 @@ char get_rel_persistence(Oid relid);
529529
#endif
530530

531531

532+
/*
533+
* ItemPointerIndicatesMovedPartitions()
534+
*
535+
* supported since v11, provide a stub for previous versions.
536+
*/
537+
#ifPG_VERSION_NUM<110000
538+
#defineItemPointerIndicatesMovedPartitions(ctid) ( false )
539+
#endif
540+
541+
532542
/*
533543
* make_restrictinfo()
534544
*/

‎src/partition_router.c‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -575,6 +575,10 @@ router_lock_or_delete_tuple(PartitionRouterState *state,
575575
ereport(ERROR,
576576
(errcode(ERRCODE_T_R_SERIALIZATION_FAILURE),
577577
errmsg("could not serialize access due to concurrent update")));
578+
if (ItemPointerIndicatesMovedPartitions(&hufd.ctid))
579+
ereport(ERROR,
580+
(errcode(ERRCODE_T_R_SERIALIZATION_FAILURE),
581+
errmsg("tuple to be updated was already moved to another partition due to concurrent update")));
578582

579583
if (!ItemPointerEquals(tupleid,&hufd.ctid))
580584
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp