pgsql: Avoid integer wraparound when adding new HASH partition

From: David Rowley <drowley(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Avoid integer wraparound when adding new HASH partition
Date: 2026-11-10 22:50:41
Message-ID: E1xQufp-00000000EPI-0uEA@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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(at)gmail(dot)com>
Author: David Rowley <dgrowleyml(at)gmail(dot)com>
Discussion: https://postgr.es/m/19836-0754d466a59c7d00@postgresql.org
Backpatch-through: 15

Branch
------
REL_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/3fe8f2c35e8aa3786e779cf077ff5415e1fcee9f

Modified Files
--------------
src/backend/partitioning/partbounds.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message David Rowley 2026-11-10 22:50:50 pgsql: Avoid integer wraparound when adding new HASH partition
Previous Message David Rowley 2026-11-10 22:50:31 pgsql: Avoid integer wraparound when adding new HASH partition