Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wNGUC-000gaO-34 for pgsql-hackers@arkaria.postgresql.org; Wed, 13 May 2026 20:47:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wNGUB-00AINi-0X for pgsql-hackers@arkaria.postgresql.org; Wed, 13 May 2026 20:47:19 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wNGUA-00AINZ-2M for pgsql-hackers@lists.postgresql.org; Wed, 13 May 2026 20:47:19 +0000 Received: from mail.postgrespro.ru ([93.174.132.70]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wNGU7-00000000SbS-31nT for pgsql-hackers@postgresql.org; Wed, 13 May 2026 20:47:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mx2023; t=1778705234; bh=s1BJVacO4LZTPPmOYTG+RhDzgJIK/yDqPNOUphIfYnw=; h=Message-ID:Date:User-Agent:Subject:To:Cc:References:From: In-Reply-To:From; b=nqhAoNhpto0hUboBRDHly0QpjMQ9w4kphkdSnmoE7/ATbXBHKhrn9N38vqrxL6keT 9gLBks8nOHp+QAClL9H90Bki5hR06jcQyzSH7ZQ+hiaURIWZ8kQb3ffLwUY97FcHEb jvLC+7tJ23WRfSbmC+M5dfaI2dYFobpmgceZRknYDAhRZi5pJkGhYDGqqQj3Km/fvS G8/Z1mglFGqUiqUze2U9NjUo/NWAPRY40pgLfA1cq1FppwmUBaksyoFTDJuNIMdeYJ S8/I2DbMOQes8EjiCiVjJ2PIflMXQLCdZVOJXE4HCddhebmPYJ1WwMa34m9hnla6oG JEAi4kVYGGZ/Q== Received: from [172.30.48.86] (debian11-template.l.postgrespro.ru [192.168.2.254]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: d.koval@postgrespro.ru) by mail.postgrespro.ru (Postfix/587) with ESMTPSA id 55F8160045; Wed, 13 May 2026 23:47:14 +0300 (MSK) Message-ID: <4df20e70-a083-4334-9548-5f8b9025847c@postgrespro.ru> Date: Wed, 13 May 2026 23:47:13 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Fix SPLIT PARTITION bound-overlap bug and other improvements To: Chao Li , PostgreSQL-development Cc: Alexander Korotkov References: Content-Language: en-US From: Dmitry Koval In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-KSMG-AntiPhishing: NotDetected, bases: 2026/05/13 19:51:00 X-KSMG-AntiSpam-Interceptor-Info: not scanned X-KSMG-AntiSpam-Status: not scanned, disabled by settings X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 3.0.0.9059, bases: 2026/05/13 19:03:00 #28589041 X-KSMG-AntiVirus-Status: NotDetected, skipped X-KSMG-LinksScanning: not scanned, disabled by settings X-KSMG-Message-Action: skipped X-KSMG-Rule-ID: 1 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, Chao Li! Thank you for the bug report, test script, and fix! >> 0. A bound-overlap bug I think this fix should be applied without much discussion: ------------------------------------------------------------------------ diff --git a/src/backend/partitioning/partbounds.c b/src/backend/partitioning/partbounds.c index 9b4277a4987..8b8f90569fe 100644 --- a/src/backend/partitioning/partbounds.c +++ b/src/backend/partitioning/partbounds.c @@ -5419,7 +5419,8 @@ check_partition_bounds_for_split_range(Relation parent, "ALTER TABLE ... SPLIT PARTITION"), parser_errposition(pstate, exprLocation((Node *) datum))); } - else + + if (last) { PartitionRangeBound *split_upper; ------------------------------------------------------------------------ >> 1. The documentation about splitting with a DEFAULT partition is a bit unclear >> ... >> 2. I found this hint message confusing: >> ... Unfortunately, I cannot comment on these points; it would be good to get the opinion of people who know English well. >> 3. SPLIT PARTITION currently provides another way to add a DEFAULT partition: >> ... Agreed, this is another way to add a DEFAULT partition. But I'm not sure that this way should be disabled (using the special function check_split_partition_not_same_bound)... Maybe it's better to keep it "as is"? -- With best regards, Dmitry Koval Postgres Professional: http://postgrespro.com