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 1wPaQp-000rd5-2A for pgsql-hackers@arkaria.postgresql.org; Wed, 20 May 2026 06:29:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wPaQn-006Lnt-2K for pgsql-hackers@arkaria.postgresql.org; Wed, 20 May 2026 06:29:26 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wPaQn-006Lnl-11 for pgsql-hackers@lists.postgresql.org; Wed, 20 May 2026 06:29:26 +0000 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wPaQl-00000000Ri8-1vIm for pgsql-hackers@postgresql.org; Wed, 20 May 2026 06:29:25 +0000 Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-2ba6485d219so31858265ad.3 for ; Tue, 19 May 2026 23:29:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1779258563; x=1779863363; darn=postgresql.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=STnvX83ZFFwtSF7O05DdaJlk+mTxnKrWt48orICSPDE=; b=RCjPk3MfltomiGIWUhgGcgZTzH6XvK7nv5N3Gl8xDH4hIZNsevtjc6v8OElcMi/yi8 hmi6YLzw0LUftj0sgazoG1weEnXw1+xYVgmVuCH+cZz0ucZb1IV/6Ly+8W5dRnNKCjCM Eo+JA4Il6oSSJW9iv3lqy2ss1QdIloon/Ju36PZRJ5t2NcWm34bG1Q+1gkzLfe29KjGY NEkoC0eTRs0ky0qcd9o6Y8oT7FoqVedG684GJO3tHTfflii2rcFae7xbWfO/vMuqlhfG +PYPVekXM/nASW/9tIoocwLYKVI2iTdDD3H/GoL+rENO3Wi/K5muBBeqOqqJe1dWRNKq xFug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779258563; x=1779863363; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-gg:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=STnvX83ZFFwtSF7O05DdaJlk+mTxnKrWt48orICSPDE=; b=Y4O23Ew5dbQF9xR4FWK9aHygVinPhaRq+h9YBJlFoY11xqDGJBJNqvCxs4GRs8/NoX KNfUSkvX/CxubudmpSdVpSREP2VledSr8LCUKPhSpRYEQUNWW5FHr8tsp+6mEaslakXC r3a5SI8QDP9xZ6SgqmUz+/ppAreQ7tBAYfFDTydYb/AzYppFyLaJqLg6GvWT360Xr3bL bnGrT5LI8zplgQpgdqPsZPVKO3n/nLKjJrEmN8rZA2GsPYa0GxUeA2Y7MBU9whJeQxUj rPjTiO/Mem4j4IGSniJQ9K884sZRV5hSNaK/6Q7y6QF7U/xIKXPNEp0+R8VGXcb/P7Ex zcWg== X-Forwarded-Encrypted: i=1; AFNElJ8T78RjJOrIdm6U0amVzuVJZQtWyh2/50/AIgsYmudCDQ68K9LbPGJkTJCfIKZtnhI9TM32OL/dJ6h8Vvpq@postgresql.org X-Gm-Message-State: AOJu0YxDh2FplnmTd8ytNGgI4rcWnr1ycsnATkM9ZHQ6YElE23FGrl2S er/aakJb4acfFwsbo6BDXNHnl7ROI1dsuJDm/KFAP1JO5F24vw+tD/iP X-Gm-Gg: Acq92OHeA7/cLHew+ZU1jes+DdQimG3lMu5i7VY/YwffdqFMEPiD0bFhms/ipc92+/z HijIcF4NBfCYLue0OmQXznmVvZQfG7lMrqlvBF++pBMknw946FBbOSPpKQUNlKtLYAscJ5+rDBf e4/dFL7drwB13D6/+goM6Jmfuhi5Z/Icn0AjZs3Of0cOal9vY76Lhg72EuxA5VuzWmhhNjL7n6H mvKnm6bGy8MZlJ8KIIRNK0O2yU8v0n+8ZjnHJlD0+MquAvdlBULg3HzfgHjSnbyJfCH71SaVaYi EG8T1I1Bv9qvVXj9Y7AzIQEeDH94BYAlU2SU5hfaBb0ggNz4IqCOJMpBGXRn1AfSeUn3aPCWWAz AkR4T67SHwLWBfMfOYUTCS8gqtHbsENs2tCchSK9h3ayn+zTUfbj5g4jFDcTt/hduGO9esNA9Yo XT7YT33XyNhrAf6t2i8Dg1m+1x6f42OD/ShSTuQrT9zg== X-Received: by 2002:a17:902:b181:b0:2b0:608d:d8a8 with SMTP id d9443c01a7336-2bd7e862606mr163124955ad.1.1779258563160; Tue, 19 May 2026 23:29:23 -0700 (PDT) Received: from smtpclient.apple ([45.32.121.103]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2bd5c263a0fsm208514595ad.37.2026.05.19.23.29.20 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 May 2026 23:29:22 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3864.400.21\)) Subject: Re: Fix SPLIT PARTITION bound-overlap bug and other improvements From: Chao Li In-Reply-To: Date: Wed, 20 May 2026 14:28:43 +0800 Cc: Dmitry Koval , PostgreSQL-development Content-Transfer-Encoding: quoted-printable Message-Id: <4AEA11EB-0439-401B-996E-F1835F510E8D@gmail.com> References: <4df20e70-a083-4334-9548-5f8b9025847c@postgrespro.ru> <4B04275C-E044-4EEE-BE64-6FEEE73DCBB0@gmail.com> <09307DC2-64A1-4D6A-9EAF-9A86A173A7FC@gmail.com> <8204A871-4650-4B3F-8260-8D5FD40908B3@gmail.com> To: Alexander Korotkov X-Mailer: Apple Mail (2.3864.400.21) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On May 20, 2026, at 14:19, Alexander Korotkov = wrote: >=20 > Hi, Chao! >=20 > On Wed, May 20, 2026 at 2:37=E2=80=AFAM Chao Li = wrote: >>> On May 19, 2026, at 19:00, Alexander Korotkov = wrote: >>> On Tue, May 19, 2026 at 5:50=E2=80=AFAM Chao Li = wrote: >>>>> On May 18, 2026, at 20:04, Alexander Korotkov = wrote: >>>>>=20 >>>>> On Mon, May 18, 2026 at 2:57=E2=80=AFPM Chao Li = wrote: >>>>>>> = >>>>>>=20 >>>>>> v3-0001 through v3-0003 look good to me. >>>>>>=20 >>>>>> For v3-0004, I have a suspicion, but it's late here and my brain = is getting slow, so I would like to study it more tomorrow. >>>>>=20 >>>>> Sure, take your time. >>>>>=20 >>>>> ------ >>>>> Regards, >>>>> Alexander Korotkov >>>>> Supabase >>>>=20 >>>> My suspicion was that check_split_partition_not_same_bound() now = has two paths. The RANGE path honors collation, while the LIST path does = not. So I spent some time creating a test that uses a case-insensitive = collation: >>>> ``` >>>> evantest=3D# create collation case_insensitive (provider=3Dicu, = locale=3D'und-u-ks-level2', deterministic =3D false); >>>> CREATE COLLATION >>>> evantest=3D# create table t (b text collate case_insensitive) = partition by list (b); >>>> CREATE TABLE >>>> evantest=3D# create table tp_ab partition of t for values in ('a', = 'b'); >>>> CREATE TABLE >>>> evantest=3D# alter table t split partition tp_ab into >>>> evantest-# (partition tp_a for values in ('a', 'A'), >>>> evantest(# partition tp_default default); >>>> ERROR: cannot split partition "tp_ab" only to add a DEFAULT = partition >>>> LINE 2: (partition tp_a for values in ('a', 'A'), >>>> ^ >>>> DETAIL: The non-DEFAULT partition would keep the same partition = bound. >>>> HINT: Use CREATE TABLE ... PARTITION OF ... DEFAULT to add a = DEFAULT partition. >>>> ``` >>>>=20 >>>> In this test, the split partition=E2=80=99s bound is ('a', 'b'), = and the new partition=E2=80=99s bound is ('a', 'A'). Their list lengths = are both 2, but the two bounds are actually different, because 'a' and = 'A' are considered equal by the collation. >>>>=20 >>>> So, in the LIST path, since check_partition_bounds_for_split_list() = has already ensured that the new partition=E2=80=99s bound is contained = within the split partition=E2=80=99s bound, we need to check the reverse = direction as well. Whether the split partition=E2=80=99s bound is also = contained in the new partition=E2=80=99s bound. If yes, the two bounds = are identical. >>>>=20 >>>> See the attached v4 for my changes for 0004. 0001-0003 are = unchanged. Since 0001 and 0003 are independent of 0004, maybe they can = be pushed first. >>>=20 >>> I've pushed 0001-0003. >>=20 >> Thanks for pushing them. >>=20 >>> Thank you for discovering the collation issue >>> in 0004. Note that original approach of using >>> partition_bounds_equal() can't handle different collations too (as = it >>> internally uses datumIsEqual()). >>=20 >> Yes, I realized that while reviewing v3. That=E2=80=99s reason I = didn=E2=80=99t get back v2 and only worked again based on v3. >>=20 >>> I've revised the remaining patch: >>> made function header comment a bit more detailed >>=20 >> This part looks good to me. >>=20 >>> and added additional >>> regression tests. Please, check. >>>=20 >>=20 >> But I don=E2=80=99t see any change for regression test between v4 and = v5. Maybe you forgot to save your changes? >=20 > Sorry, I just mess up, no changes in tests. > I'm going to push this if no objection. >=20 No worries. Then v5 looks good to me. Best regards, -- Chao Li (Evan) HighGo Software Co., Ltd. https://www.highgo.com/