postgres.git / summary / log / commit / refs

commit    61afc2ecdbe7e51e94ebaacb6803b4e22f00eb76
Author:   David Rowley <drowley@postgresql.org>
Date:     Tue Nov 10 22:39:36 2026 +0000
First released in: 19.0

    Avoid integer wraparound when adding new HASH partition
    
    Specifying an overly large modulus could result in an integer wraparound
    while checking for overlapping partitions when adding a new HASH
    partition.  Upgrade to 64-bit integers to avoid this.
    
    Bug: #19836
    Reported-by: Sumedh Pathak <sumedhpathak@gmail.com>
    Author: David Rowley <dgrowleyml@gmail.com>
    Discussion: https://postgr.es/m/19836-0754d466a59c7d00@postgresql.org
    Backpatch-through: 15


src/backend/partitioning/partbounds.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/backend/partitioning/partbounds.c b/src/backend/partitioning/partbounds.c index 63e89fd4ef8..020a37161a3 100644 --- a/src/backend/partitioning/partbounds.c +++ b/src/backend/partitioning/partbounds.c @@ -2931,8 +2931,8 @@ check_new_partition_bound(char *relname, Relation parent, if (partdesc->nparts > 0) { - int greatest_modulus; - int remainder; + int64 greatest_modulus; + int64 remainder; int offset; /* [parent: 9d9157cd94ae]