public inbox for [email protected]  
help / color / mirror / Atom feed
From: Alexander Korotkov <[email protected]>
To: [email protected]
Subject: pgsql: Fix SPLIT PARTITION range bound validation with DEFAULT
Date: Tue, 19 May 2026 10:55:08 +0000
Message-ID: <[email protected]> (raw)

Fix SPLIT PARTITION range bound validation with DEFAULT

When splitting a range partition and defining a new DEFAULT partition, the
validation checked the lower bound of the first explicit partition and the
upper bound of explicit partitions only when they were not first.  If there
was exactly one explicit non-DEFAULT partition, its upper bound was therefore
not checked.

This could allow the replacement partition to extend beyond the upper bound
of the partition being split, potentially overlapping another existing
partition.

Fix this by checking the upper bound whenever the explicit partition is the
last one.  Add a regression test covering the single explicit partition plus
DEFAULT case.

Author: Chao Li <[email protected]>
Reviewed-by: Kirill Reshke <[email protected]>
Reviewed-by: Zhenwei Shang <[email protected]>
Reviewed-by: Dmitry Koval <[email protected]>
Reviewed-by: Alexander Korotkov <[email protected]>
Discussion: https://postgr.es/m/[email protected]

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/9354896920e4b2efd3b1b88caaea4e0c9071acb2

Modified Files
--------------
src/backend/partitioning/partbounds.c         |  3 ++-
src/test/regress/expected/partition_split.out | 16 ++++++++++++++++
src/test/regress/sql/partition_split.sql      | 15 +++++++++++++++
3 files changed, 33 insertions(+), 1 deletion(-)



reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: pgsql: Fix SPLIT PARTITION range bound validation with DEFAULT
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox