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 1wPnXj-0012Io-0n for pgsql-hackers@arkaria.postgresql.org; Wed, 20 May 2026 20: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 1wPnXf-008Q0K-2y for pgsql-hackers@arkaria.postgresql.org; Wed, 20 May 2026 20:29:24 +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 1wPnXf-008Q0A-1x for pgsql-hackers@lists.postgresql.org; Wed, 20 May 2026 20:29:24 +0000 Received: from mail-ot1-x336.google.com ([2607:f8b0:4864:20::336]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wPnXe-00000000bXj-1dlq for pgsql-hackers@postgresql.org; Wed, 20 May 2026 20:29:23 +0000 Received: by mail-ot1-x336.google.com with SMTP id 46e09a7af769-7dea20cf21aso5137575a34.1 for ; Wed, 20 May 2026 13:29:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1779308960; cv=none; d=google.com; s=arc-20240605; b=Tyoi3afYVHRDG6eDhWOGL6XbEaOujuuXkl+0HPtTeTsqDn4hM/eMIjk2KhUZXBF0Vs LaRgWMB4o5oIWwCfoqqMAfOPtcX10CIaYwkioCxQbAeqhbQrcd2VI6Ua6MTrww6c0bJn gyvef7/HDBZ/dEep8NYPfI42pgpj+L3sfwLbqB4KyoNVTJcEGqW0qlSGpVdXjSM+ICOR RyzFQvMso/OmdlHd4sjYttNZmAAAdoAUt15YRDwm1u7uUKAHZfxfeatz6W1v42qjqX6I LKV9TmnYUwyGFvhMhC2teByYCKCEHchneLMDENMQn+KWXjG/S9deD/AhjloijzGiEi3O hEmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=9cxGNoRCZ+HqVYH5MnQ4Y+DNKEAUUr5pxbxk7t67F54=; fh=QrXAOlAEBa9V+IQkbl1M0uGn0QoafO56P5KICEOn5SU=; b=a+gkuSQDTapJjQXfiUP6BfmjT1w5tzfidbIGnJjYGZ2o/aMihos7MopNPCc+zoluQN f0tCUrLScvRboRL6m3YHGZWIHhDsGWB0tnIuDXjaAEtgHUVb7fbvWNAx8NaASzEA5OKF 7IJMXUIn9KaoEx2FBW9/ecxOUC72j5nQk+WMmHacwuuPbzu7j6TnU1HCdjM7t1/fu/Zb pvAKuNbD+jcllS0SKBFubH6fFM0zz0YpsHsjzRL+TmLpgbSbPIdQq66P53E5r6pnt9V/ Wig/61/2aOVcsYlNYF4NK5BwLPpVM23GpVL1t06G8G/g9IffipWj2R6sbP2LCY9N00/9 t+jA==; darn=postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1779308960; x=1779913760; darn=postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=9cxGNoRCZ+HqVYH5MnQ4Y+DNKEAUUr5pxbxk7t67F54=; b=nz86qUt2UIZPwwhZuyYrkKG/mf3OVJLx2rrk3+tc3QX5Y5ZF0pi/fA07XROHmWN3kZ mtVkvdhDHmOryH2L2MzcAppAHqME4YGwT0fNuyTSsqg8q9/gDdIqRNJ+vm4JV2W8ad8u XtoLNgzkZB4sfTNfuwotIVfVfAQKuzE4tXXOp7OmH/m3BDdOspai2m7Q282Ee5kqa76H D7F8+8C3SwCgtoZO8NpwweSnvhJeqDrncaYY3aXsCy9wdIOqBjWhK4LBCRqWnDel38rK LLSqi6B/zQw2//9AyqxpSU56xoF4pZoDOnDmq0U9ojLxXpLWxnKwXszRjWnkh5aQVB1h 89ew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779308960; x=1779913760; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=9cxGNoRCZ+HqVYH5MnQ4Y+DNKEAUUr5pxbxk7t67F54=; b=Q9mQuru9wxxP0IHPUe82ZJ/6fGI4QlmZqffzMsTcKo9xeiMePtVlHXDANlYTX8sBLv NFF4AG40XhqrgaaZYY1rtr0ex5UT6IhcCXWdQcpYfQbsPpqj5DBf1oD7v3YDQP4zbLaj Fzp9UrV2A4bdknqZM1jMKtOQ6Z44t89nFe2e5VZbzHuVlT4LuuQcjOgwiPYx5Q3e/1Mi t/qylwQq21J7F/2H5R+SAEqeF4GdPLiQ7Z08AxdltgLMgOUSrxvH7Yxntz7VuSc2yLcs cCwxAiR1gVRmPtn94LMKYui4bQr1Qof/0l3/goZVN7s+ueNTk/HqsiTKmJI0EOX3dhcm geWg== X-Forwarded-Encrypted: i=1; AFNElJ/BWUq8VnX84n9rzrI8yn1BIMEH56i/TYKqCfl3JWKlGsg/7TdcT1gKCMPV5mnw8EMrkTrAwekmc9DePUc6@postgresql.org X-Gm-Message-State: AOJu0YyeIPKTkVatMscn/GSiHSjjrQ40lS2NvvFDYJs42UnumcPTk80q QHgdws4RMIdZo6PZA0TCskK8n7FtDK42zqdI8OFf65nQ3i/dDyhtXhPp3pG4qLNEGwLh/5yzHKN pNe5ZyKEaEUoQ0DlKXPFO9Fm7PT3VS0c= X-Gm-Gg: Acq92OGYQVBcchPI5rNckAmFqCQGhExT9tiYBJt7ePLEg9eomLSNJrf2VLr4wdcrKQr tDKTcejYevvkovaVvk6Ti5XzLrBpcoNvqkTByYMhRg/QeNJf12Ynz8frgOJ1P9l3b1vsv6+XEFH kLzNP2gSkAimCpanT01RLRkZFE0TZo/x/372+dggfi0tZpyE22KOhJhCkcfax6fxsS/6lzyqsQH xkcv86PVGPkFKDjExnUIA4QBTh8K0EWEIXOCcZImyhf7DEb6krB6PcG0sUUXe16pxGfdmhqcxIl zFWizhtFo5zRvYqvbu/Wat1uXR1Dxi1qVMduCvrHQvth0j39uwDOR/sm5tefSw17KcYVdROojgy x0abaXby5H62cEbqxf71A0oE79ek7KRAXoIG0MoX8 X-Received: by 2002:a05:6820:990:b0:696:924d:2956 with SMTP id 006d021491bc7-69c942daedcmr17294911eaf.14.1779308960553; Wed, 20 May 2026 13:29:20 -0700 (PDT) MIME-Version: 1.0 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> <4AEA11EB-0439-401B-996E-F1835F510E8D@gmail.com> In-Reply-To: From: Alexander Korotkov Date: Wed, 20 May 2026 23:29:07 +0300 X-Gm-Features: AVHnY4Ke1alwWLWMh0b7PawjHRfROktD6Liwp1W8fta5FiDS7lWa01EGZ2I9jS4 Message-ID: Subject: Re: Fix SPLIT PARTITION bound-overlap bug and other improvements To: Chao Li Cc: Dmitry Koval , PostgreSQL-development Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, May 20, 2026 at 2:46=E2=80=AFPM Alexander Korotkov wrote: > On Wed, May 20, 2026 at 9:29=E2=80=AFAM Chao Li = wrote: > > > On May 20, 2026, at 14:19, Alexander Korotkov = wrote: > > > 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: > > >>>>> > > >>>>> On Mon, May 18, 2026 at 2:57=E2=80=AFPM Chao Li wrote: > > >>>>>>> > > >>>>>> > > >>>>>> v3-0001 through v3-0003 look good to me. > > >>>>>> > > >>>>>> 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. > > >>>>> > > >>>>> Sure, take your time. > > >>>>> > > >>>>> ------ > > >>>>> Regards, > > >>>>> Alexander Korotkov > > >>>>> Supabase > > >>>> > > >>>> My suspicion was that check_split_partition_not_same_bound() now h= as 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 collati= on: > > >>>> ``` > > >>>> evantest=3D# create collation case_insensitive (provider=3Dicu, lo= cale=3D'und-u-ks-level2', deterministic =3D false); > > >>>> CREATE COLLATION > > >>>> evantest=3D# create table t (b text collate case_insensitive) part= ition 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 parti= tion > > >>>> LINE 2: (partition tp_a for values in ('a', 'A'), > > >>>> ^ > > >>>> DETAIL: The non-DEFAULT partition would keep the same partition b= ound. > > >>>> HINT: Use CREATE TABLE ... PARTITION OF ... DEFAULT to add a DEFA= ULT partition. > > >>>> ``` > > >>>> > > >>>> In this test, the split partition=E2=80=99s bound is ('a', 'b'), a= nd 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. > > >>>> > > >>>> 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 w= ithin the split partition=E2=80=99s bound, we need to check the reverse dir= ection as well. Whether the split partition=E2=80=99s bound is also contain= ed in the new partition=E2=80=99s bound. If yes, the two bounds are identic= al. > > >>>> > > >>>> See the attached v4 for my changes for 0004. 0001-0003 are unchang= ed. Since 0001 and 0003 are independent of 0004, maybe they can be pushed f= irst. > > >>> > > >>> I've pushed 0001-0003. > > >> > > >> Thanks for pushing them. > > >> > > >>> 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()). > > >> > > >> Yes, I realized that while reviewing v3. That=E2=80=99s reason I did= n=E2=80=99t get back v2 and only worked again based on v3. > > >> > > >>> I've revised the remaining patch: > > >>> made function header comment a bit more detailed > > >> > > >> This part looks good to me. > > >> > > >>> and added additional > > >>> regression tests. Please, check. > > >>> > > >> > > >> But I don=E2=80=99t see any change for regression test between v4 an= d v5. Maybe you forgot to save your changes? > > > > > > Sorry, I just mess up, no changes in tests. > > > I'm going to push this if no objection. > > > > > > > No worries. Then v5 looks good to me. > > Thank you, pushed. Uhhh, most of buildfarm animals don't support locales used in our tests. I've to revert that, ------ Regards, Alexander Korotkov Supabase