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.94.2) (envelope-from ) id 1uy4C4-003bHG-Nl for pgsql-hackers@arkaria.postgresql.org; Mon, 15 Sep 2025 08:04:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1uy4C1-00AZqG-Aq for pgsql-hackers@arkaria.postgresql.org; Mon, 15 Sep 2025 08:04:10 +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.94.2) (envelope-from ) id 1uy4C0-00AZq7-T3 for pgsql-hackers@lists.postgresql.org; Mon, 15 Sep 2025 08:04:09 +0000 Received: from mail-il1-x12a.google.com ([2607:f8b0:4864:20::12a]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uy4Bz-000VWH-25 for pgsql-hackers@lists.postgresql.org; Mon, 15 Sep 2025 08:04:08 +0000 Received: by mail-il1-x12a.google.com with SMTP id e9e14a558f8ab-423394b393eso12024415ab.1 for ; Mon, 15 Sep 2025 01:04:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1757923447; x=1758528247; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=+HS3pLLXEbG9Ch1jI/cmcFEtKlgeWgjTkIaPIw+SIiQ=; b=HTVUzCf5k5I4H17ygqoHa76u6OiNl7sYDO9nEaA2g1jg5MbEEKjnwYKNLnrniY6sOe az0XQKJgziJKZHi0lEJjtaOIQamvOcSHVK0YcpMOWQr7bch2f1I68oLNXicpH9ScNk5q Z5PphSeytSumyiJEIH01SoA4YX//9buZj1jfDuvBEw3u/KUoF1HeSSYUNmllE6UVbOGe YuBm89ymlre22C6Bx9FemRVE24e6UKNAJ0byNGr3IfVE4yeEXGzICLGliJTiRWJb6JDh x4ajGX2u5+YvSC1Kgm9IeSWIkV7BrJX0Jbssz5wONazSFvLpubSdWoPhGdFfv8rmkDcz fFLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1757923447; x=1758528247; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=+HS3pLLXEbG9Ch1jI/cmcFEtKlgeWgjTkIaPIw+SIiQ=; b=dTyUZtr6e/aDA0fYNteD0aKScMbhXvqqEeb30zmO98BgAZ0Rrl/Ha9xrUQuUO0a3VV XXBPJltUQZXFiT+IKf5/iam+vAS3VCyhDu77egGolBUqIlKBAXDMIsPn3tZM8sGpGG+T 560h6UbCvqFoBq3sTxHZ/8WXw2mvop3upGr+R48UJbPQDYMUdPWDTRZq6gSo3EGlhKcn 0IHFFNLqgU/7XcMCWjV0BbBGNYD1lT+Pl2KwbwXitwW05wgEiz1l8xpVTlhWof8zUrgP 1QMC85wsTuP1k7KZAac1ABjCLGOPLsWb7Fs9ZAobo7WW5uVQj1lbYlXd6pW8N/renDxL KyQg== X-Forwarded-Encrypted: i=1; AJvYcCVm5bKUTEhxjlbdS3C5rL3oIC2wTLX8KvCOpwfJLEWxgGusf+IQnYV3F4aNemGLp7tfYNjzdoT1ZNN9r+at@lists.postgresql.org X-Gm-Message-State: AOJu0YyLiuB50ZSjvy8lYOCIGRnwyAwdWYSnryW41saG8RUcG0HXMt11 ZMOJNY/tfW7JOSHLr0d1TqKz5fmfOV1KGji3d1Nugax118sU5OPy5J1qnCG3cW7N27eeN3plgHN k7M4rZyKBfSdDw8RE8G3AQ08gMpxUXSI= X-Gm-Gg: ASbGncuiko7THm1SHJ235HoU3nV3bv00I5CWfaXC9lrFDccnmIJN/XXEu/gRIthl+cp wMrZvfDFOuGBlbwOQ+Pp+DysbpyEB4/O3tXq6/8tHOKIIiupiopBJqKRLwLzw0UbjnLFZTo0FaZ M8yAGAg3bmbb3u9fGQcgz0Dp42avt/mqvlbDsXQWh62TrgFDLLAb1prjbH8tNX51bRjWU4n8flQ zxPwJSWoH6wwMUiHA== X-Google-Smtp-Source: AGHT+IFLCqVsUiCPqS7kSOQjFgbH46F//XUnxnn/aMjw6K/kl6A8p9oUfOSHUuaXwuwdjmd7YBOk8YiY3m2g2cSdnCo= X-Received: by 2002:a05:6e02:1a0a:b0:41a:a460:f901 with SMTP id e9e14a558f8ab-420ceec06bamr126425295ab.9.1757923447245; Mon, 15 Sep 2025 01:04:07 -0700 (PDT) MIME-Version: 1.0 References: <171085360143.2046436.7217841141682511557.pgcf@coridan.postgresql.org> <195b67ee-ef41-4451-9396-844442eef1a4@postgrespro.ru> In-Reply-To: From: Alexander Korotkov Date: Mon, 15 Sep 2025 11:03:54 +0300 X-Gm-Features: AS18NWC74KZaCP5oiTl1f3Lyq3hVGWEKHjHM0y3op1c5tfJGOsLQ22usmTve8z0 Message-ID: Subject: Re: Add SPLIT PARTITION/MERGE PARTITIONS commands To: Dmitry Koval Cc: jian he , pgsql-hackers@lists.postgresql.org Content-Type: multipart/alternative; boundary="0000000000009d9e41063ed2721e" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000009d9e41063ed2721e Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Dmitry. On Mon, Sep 1, 2025 at 2:04=E2=80=AFPM Dmitry Koval wrote: > Hi! > Thank you for the notes and patch! Some additional notes from me. 1) src/backend/parser/parse_utilcmd.c includes are not alphabetically ordered here +#include "partitioning/partdesc.h" +#include "partitioning/partbounds.h" 2) There is unicode dash in the comment of ATExecMergePartitions() here. I suggest we should stick to ascii. + /* + * Check ownership of merged partitions =E2=80=94 partitions with diffe= rent + * owners cannot be merged. Also, collect the OIDs of these partitions + * during the check. + */ 3) Regarding 17bcf4f545, I see btnamecmp() is collation-aware. Should we also specify COLLATE "C" every time we do "ORDER BY relname"? 4) This comment sounds misleading. Probably it should say "are contained". +/* + * check_parent_values_in_new_partitions + * + * (function for BY LIST partitioning) + * + * Checks that all values of split partition (with Oid partOid) contains in new + * partitions. + * 5) Given what latter items say, I think the 1. should say "The DEFAULT partition must be at most one." /* * check_partitions_for_split * * Checks new partitions for SPLIT PARTITIONS command: * 1. DEFAULT partition should be one. 6) Regarding the isolation tests. I see we are exercising INSERTs and intra-partition UPDATEs. Should we also try some cross-partition UPDATEs? ------ Regards, Alexander Korotkov Supabase --0000000000009d9e41063ed2721e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Dmitry.

On Mon, Sep 1, 2025 at = 2:04=E2=80=AFPM Dmitry Koval <d.koval@postgrespro.ru> wrote:
> Hi!
>= Thank you for the notes and patch!

Some additional notes from me.
1) src/backend/parser/parse_utilcmd.c includes are not alphabetically= ordered here
+#include "partitioning/part= desc.h"
+#include "partitioning/partbounds.h"
<= br>2) There is unicode dash in the comment of=C2=A0ATExecMergePartitions() = here.=C2=A0 I suggest we should stick to ascii.

+ =C2=A0 /*
+ =C2=A0 =C2=A0* C= heck ownership of merged partitions =E2=80=94 partitions with different
= + =C2=A0 =C2=A0* owners cannot be merged. Also, collect the OIDs of these p= artitions
+ =C2=A0 =C2=A0* during the check.
+ =C2=A0 =C2=A0*/

3) Regarding=C2=A017bcf4f545, I see btnamecmp() is colla= tion-aware.=C2=A0 Should we also specify COLLATE "C" every time w= e do "ORDER BY relname"?

4) This comment sounds= misleading.=C2=A0 Probably it should say "are contained".
<= div>
+/*
+ * check_parent_values_= in_new_partitions
+ *
+ * (function for BY LIST partitioning)
+ *<= br>+ * Checks that all values of split partition (with Oid partOid) contain= s in new
+ * partitions.
+ *

5) Given what latter items= say, I think the 1. should say "The DEFAULT partition must be at most= one."

/*
=C2=A0* check_partitions_= for_split
=C2=A0*
=C2=A0* Checks new partitions for SPLIT PARTITIONS = command:
=C2=A0* 1. DEFAULT partition should be one.

6) Re= garding the isolation tests.=C2=A0 I see we are exercising INSERTs and intr= a-partition UPDATEs.=C2=A0 Should we also try some cross-partition UPDATEs?=

------
Regards,
Alexander Korotkov
Supab= ase
--0000000000009d9e41063ed2721e--