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 1weeHi-004vUi-0M for pgsql-hackers@arkaria.postgresql.org; Tue, 30 Jun 2026 19:38:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1weeHh-009pxa-05 for pgsql-hackers@arkaria.postgresql.org; Tue, 30 Jun 2026 19:38:17 +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 1weeHg-009pxS-2P for pgsql-hackers@lists.postgresql.org; Tue, 30 Jun 2026 19:38:16 +0000 Received: from mail-qv1-xf2b.google.com ([2607:f8b0:4864:20::f2b]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1weeHe-000000014fc-2u1P for pgsql-hackers@lists.postgresql.org; Tue, 30 Jun 2026 19:38:16 +0000 Received: by mail-qv1-xf2b.google.com with SMTP id 6a1803df08f44-8ef7b7651ecso11484626d6.1 for ; Tue, 30 Jun 2026 12:38:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1782848293; cv=none; d=google.com; s=arc-20260327; b=Qd4EPnWHlDhZmWS4voN1QA0marlzs8fO5F0cQ3hUmUU/bkgd095cqpfenfT2BTEenl uRWqqkKqFUKmy5PP+2kxH/q78H6trFCmBya7nNjCILiCKYWJ7RRti/WjTVImwIFDRPNu xrYiYfSVLAm12J5+mp7yl4yx2QVtyKLQlKlK1TGbRui9fpBbcvE+COqvfvxh1s4+8R06 z+Bie6j77LvTV3vtLHtBKoCKZl7R8fWaumZg5fo0bqlJNjaupg10EQJ7hUyaodPngOph 8x8NXcxdnSg7MI3znhBFMAHdLxX77d3gUWhuXx016lVTWAavReHkKv52YQ5A472xes0q L9/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=uWk3maaoZvbB/MF/314avRYc4z5QgSlPocv2JthyB48=; fh=nC7ZfeJnuTXCwuFqu5qs3kXulM9t/Gll5svgJWpJMPE=; b=ssj3S+8NjAEYCzkt7yCRmTkRzX48pGSJF1oKYmc0k+NiJUU1gdgliag69ZALz/m/gR tf32cv4KlOgZH6PV2h4G/ao0cgvUsX/nZiYJ7aCIXHant755aEifCz8RTI8FsmeZUFBL WzdC5hvbfaNigj08Xwgnrk1c8IBoDW3pE/K5lcssdYFVgz1aaRzpv3IUn3tS5AzcFcjK /+cD3UP1tf7wVZrms/O9fIXvvFJ7M629WXm2wVZSjXswSH6o8CeR1I8d2m9EhIzwy3iy TQO9s5wiXfi0XHWAuvcWITyooi3EFT8x8gOGA3krv7DnG8xLFiyOsZG1TcdwV7/lU7a5 C2mQ==; darn=lists.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=1782848293; x=1783453093; darn=lists.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=uWk3maaoZvbB/MF/314avRYc4z5QgSlPocv2JthyB48=; b=rQjm31FRVaVYHEf81GLTErBp3iuwMC20u3zADEtnMr1AK/ylRC9z2cwQMgY0fBOmBt /CsNe8uG/O4Og02jjXyOuZNhCozEG8r5dLaWm4hr6rZ2CpbPDZ3mVlT9zE440MREaYbS dfn7gRLbKp6iNRJjlo/lN3bZsUiTU8g/9f4rWhVd1m1rEAHznhwZBEl7C8YL64XMMrh4 IPi9BjH4ToTWzxDJBIwuxM5PGgDSeXJkLncyBydw8ztr0RnLX+fQBGEW6lMSUv3G5l+d ZqK2BcLJtGsV+JTtwTKQpJtmPQO1rWDOYZZ6PrYllpP06enb4wwLQN470zf/hBNBn/4+ 3RbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782848293; x=1783453093; 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=uWk3maaoZvbB/MF/314avRYc4z5QgSlPocv2JthyB48=; b=K43yO4Qs1oinwoYPHhPm1DohN5pQVIJYLGpVRARkt4OZEL9ch5J/DLoEfoVme76r7v blpdEWU1BIqW9JhX0Hc+Ywoujhl1NYWcuhvY3dZXdn1IVca/fJo1kN9T9qFdD7bF/lY6 Df0ofE5YDV3WmKNcucVf/X3WZdjUoiWfwNIKQLRgHy0oX+rm6Craw546e0idcH7bCgVX 0Vw+qcCQ46/vPamJYv9rm4EeNvPIcrexuVHuOM4iSODEux1IT1vTkOb7AXsn55jkQiEt 0mqYQntAuVgSVtnwJLD5DE8gjLCoh1+8zW2nIlNbS0+Pbmet+jac3fSuKkBklFNkFH7N GiMQ== X-Forwarded-Encrypted: i=1; AHgh+Rqrd8R3ROgKCFdJZFtLp94kPeaCHwupbBAR/m3CaELFZWqpxqm6lF5mn6tw5ueqw+jejFhK9L1kITnzENTQ@lists.postgresql.org X-Gm-Message-State: AOJu0YyMld3L1V+XKXVY8loDw7xZogAekTHJa3XvQXhvpyeO68WnBwod GmWLPy7D2CFAlVZXW/1VL/fvnCwJgT8GAuC6cbNYNyGOLYDFaR858r1lAEhfPRbzYz9+X92eoQZ Rqq78Ms5KTB6LAAsmELyBGz7oK+TS9OQ= X-Gm-Gg: AfdE7clUlAKHZe04QXSzu+F6BFY4AYGTczAPm0VpteXjrOJgUV2Jj9/pLoP3bbYBPDZ kPtLu7zPWeXMatwJP064VUfd+agZSF/NTXAV1rRsgDZInlnF+4G34Q9zkAjB5rB4j9mqTJba+5S ZPVjOcpaaXYmq8zD+GGXIWeOvgkbuxqTvJwMyptjzq0YcXRkgYfJj6I2FXKJq8DZDf57++4mJXz ZPP69cYk3hYv99TZyo3irfOufiJXYnbJpT497frWYCWcRvLBXWt/sZGZe+6pCjY+sInBGHQHYKO UQ2OOGSwiy3QpP6gAGNTNsXnnUssPgbirZssxUr7uxcc1SCcUX+WnoETAUbeF7GwIwiZCTKg5kY 7Nl3l X-Received: by 2002:a05:6214:c46:b0:8ef:74ad:e62b with SMTP id 6a1803df08f44-8f2528ea6eemr40642316d6.7.1782848292698; Tue, 30 Jun 2026 12:38:12 -0700 (PDT) MIME-Version: 1.0 References: <232439a3-af7a-4a13-82ae-33da5520d4bf@postgrespro.ru> In-Reply-To: From: Alexander Korotkov Date: Tue, 30 Jun 2026 22:38:00 +0300 X-Gm-Features: AVVi8CeZ_HCxNRtUCZ_OmuZfSU9C6zCfLanoVuNRThZ3EG3mV8GIXaFDsf7kl1s Message-ID: Subject: Re: Add SPLIT PARTITION/MERGE PARTITIONS commands To: Pavel Borisov Cc: Dmitry Koval , Justin Pryzby , pgsql-hackers@lists.postgresql.org 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 Hi, Pavel! On Tue, Jun 30, 2026 at 2:25=E2=80=AFPM Pavel Borisov wrote: > On Tue, 30 Jun 2026 at 15:07, Alexander Korotkov w= rote: > > On Fri, Jun 26, 2026 at 10:50=E2=80=AFPM Alexander Korotkov > > wrote: > > > On Fri, Jun 26, 2026 at 6:20=E2=80=AFPM Dmitry Koval wrote: > > > > If we exclude case with DEFAULT partition, MERGE PARTITIONS command= was > > > > intended to be used when an incorrect table partitioning was chosen= . > > > > For example, a table was initially partitioned by month, but later = we > > > > needed to change table partitioning by quarter. In this case, MERGE > > > > PARTITIONS command should merge several adjacent partitions into on= e. > > > > Current checks are made for this case. > > > > > > > > >- If there's *no* default partition, then I think the check shoul= d be > > > > >relaxed; it's sufficient to verify that the bounds of the merged > > > > >partition do not overlap with any partition which is not being me= rged; > > > > > > > > It's probably possible to do this. But in this case, the command wi= ll > > > > not exactly be "MERGE PARTITIONS" ("MERGE PARTITIONS & EXPAND"?). > > > > > > +1, > > > We can implement a support for this for 20. For 19, I propose to > > > state the restriction more explicit in the docs. See the attached > > > patch. > > > > I'm going to push the docs patch if no objections. > I looked at the doc patch. IMO "in order to be merged" is redundant. > I'd propose following: > "For range-partitioned tables, the ranges of merged partitions must be > adjacent. This applies even if the partitioned table has no default > partition." I've included your suggestion. Pushed and and backpatched to 19. ------ Regards, Alexander Korotkov Supabase