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 1wPTzz-000lHt-1j for pgsql-hackers@arkaria.postgresql.org; Tue, 19 May 2026 23:37:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wPTzx-005N73-1Y for pgsql-hackers@arkaria.postgresql.org; Tue, 19 May 2026 23:37:18 +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 1wPTzx-005N6v-0I for pgsql-hackers@lists.postgresql.org; Tue, 19 May 2026 23:37:18 +0000 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wPTzu-00000000SDz-3SZy for pgsql-hackers@postgresql.org; Tue, 19 May 2026 23:37:16 +0000 Received: by mail-pj1-x1032.google.com with SMTP id 98e67ed59e1d1-3697c35eab7so2284742a91.0 for ; Tue, 19 May 2026 16:37:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1779233832; x=1779838632; 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=dWyOMt3j/t/tk2Gfo/6IVp0m33mUaUQwbEUIw28VGzA=; b=qhWIsoxMikf46k8lKjwai8BQd6EbTV6wpc4iSCkS0T7G0bgHe/qL1rv96omqtHxPU8 cdmyjFrBC5xdDdFJlgCkLLqhsNVfnBkUrLJO7JxPG4BWs8NyNJ1XlMvasbU2rGlbbU3P J/mF9hMhjw8GvpJDN30WeMDZk9KuT6+KtS4jnOu7RvlHyeKnlG/h2qtfixMgTZrXdwRT 9wGbROFeF+7H90Qmjaw/jyy1t2PT55sTLcXMZv77M7wntlGzNwiw1qhWNrw49BeXIfkW I+rCYS84R518O98/NLauEbhvGnyWVuenHsORW4ThAdwqup/N26+pQHatwvhDwoGTWd8K +a5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779233832; x=1779838632; 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=dWyOMt3j/t/tk2Gfo/6IVp0m33mUaUQwbEUIw28VGzA=; b=UYSw3OyWQkhGAPcosRiwh12Ce95KcnPOa658Hm+/b0bK5eoX7CZIJUBUpo3CtH/WYh akOjJgcEuwHj71oZZ9I+d3xjaWVsZmhlf9XDM0c5S3ceb2ga0aUfI+jfkH3WwMbnqEJ+ oAIAdHUK9QhbDtsVhmWUZXLxsaRBv6xOFetY8HFfd1ifnyjhebYSlfD+IzLeokf+7b4c 71vXJ7QBS47jEQOQBrQHKULQ+QBCQhfJQP5AKyuhyDV4+rbkInXW02Ap4Cj6sCMrPXqi Y/1ExqaBb7AdcfHkx+1yNILFkHb3gVlK0dV4K7Th73U3CEbj3LeSvm1j9GDxeHyHAjsf Civg== X-Forwarded-Encrypted: i=1; AFNElJ8t5o/jT5EGwKRs1DxwfGs/YqqMDZ1PrKw7p6GOzyTcedKXTRUkX7XkZHb2dWhUXk5yNtsCNHg83tGg7tCu@postgresql.org X-Gm-Message-State: AOJu0YzFPdGVhwqXw4BCT3eKIvrrza6GKwQ+ZlL3hJ5nkx3u4h75guC6 8/2oSOHHaqFJePg+sUw95Hrtp6P8cuM82AJDdOCgNXKc/WliByRbXTxQ X-Gm-Gg: Acq92OG9TcVPOK+ZdNXkYlSglNj58J/BTHewGyDzd2T7cBQh4Wdo5MzvqZmQxReCgUM 7n/jR7qAx4a+KSDAqM05pm0zA+Ew++Lb4sYG1I5vJh246uwYOiuwiOJN/ybBccNjGVnHx5/0DVo S4q+47RPRjND+29dqpA0Li0gkGVhCOAIEnKbrfdv5IpZ0XBLzgYQqvRY7I0Fy5q3CbnwQP+fDIB mlsE3vOdaBs/bIzwtt3IsyQ1uGIssod6JXizIrt6qHelkT+CL7UFv69cHWerWOCKP+6IrvvicVR Ds/9f8dm55N0DkSYnWJdoqFpZFrRGVz8un0az9QRNQzT3wD9cbnSw4363CXzVFPKCT/2x8TZc/m iIDSp5d8sUrm7W2PaRDodJxg3uaYqCXV2bRM2LOdehl5CQ6xqI+7h2XjF76pqXuibF6iGGPtjg2 KZh9vA6C2y092TZfp/Xmz1fhz7Ze4RKWLuHuZFZPOzcg== X-Received: by 2002:a17:90b:270d:b0:35b:e5ce:73bb with SMTP id 98e67ed59e1d1-369518b2429mr19962448a91.1.1779233832227; Tue, 19 May 2026 16:37:12 -0700 (PDT) Received: from smtpclient.apple ([45.32.121.103]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-36951437316sm15557279a91.11.2026.05.19.16.37.10 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 May 2026 16:37:11 -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 07:36:32 +0800 Cc: Dmitry Koval , PostgreSQL-development Content-Transfer-Encoding: quoted-printable Message-Id: <8204A871-4650-4B3F-8260-8D5FD40908B3@gmail.com> References: <4df20e70-a083-4334-9548-5f8b9025847c@postgrespro.ru> <4B04275C-E044-4EEE-BE64-6FEEE73DCBB0@gmail.com> <09307DC2-64A1-4D6A-9EAF-9A86A173A7FC@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 19, 2026, at 19:00, Alexander Korotkov = wrote: >=20 > Hi, Chao! >=20 > 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. > 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. > 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. >=20 But I don=E2=80=99t see any change for regression test between v4 and = v5. Maybe you forgot to save your changes? Best regards, -- Chao Li (Evan) HighGo Software Co., Ltd. https://www.highgo.com/