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 1weWb9-004qgT-1w for pgsql-hackers@arkaria.postgresql.org; Tue, 30 Jun 2026 11:25:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1weWb7-007q6d-1H for pgsql-hackers@arkaria.postgresql.org; Tue, 30 Jun 2026 11:25:49 +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 1weWb7-007q6V-0K for pgsql-hackers@lists.postgresql.org; Tue, 30 Jun 2026 11:25:49 +0000 Received: from mail-ed1-x531.google.com ([2a00:1450:4864:20::531]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1weWb5-00000000zox-0z1t for pgsql-hackers@lists.postgresql.org; Tue, 30 Jun 2026 11:25:48 +0000 Received: by mail-ed1-x531.google.com with SMTP id 4fb4d7f45d1cf-698823a9881so429994a12.2 for ; Tue, 30 Jun 2026 04:25:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1782818745; cv=none; d=google.com; s=arc-20260327; b=VKGjKzDzBPbeDIMycJlJgMwN8jtcYNEEE6Lx6c56BsjECte6LNRgp3Dx4dq5P7Aucs MiIdIu+R+ycw75X/qZ4ws6dJZjFitMxpqFHc2wTvTo5IjNclSDypX4fnDxqrlVsCUdZ+ ayfiImyF3XRV0QeLkjm+ZROiF6VqdCvhpNhssQsgNXpBJLj8RWmDdtpKlXENDAGp+U1E 3rj2B84Kz/zqDccqXIt78iYO/59NTt6QMgVwvqvzbR56BCgLcWf3RsU3dm577IMpod+q YVS+SiXrWYC13WyhN2BpzSSpvraUsgQbUNTgIYUz+0C+WTfO9+jfQWWzOWfoxfxPzI/l BtHw== 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=vpcwfF0FDeKVqrHhZmRHg18AUlXqi70eWXFt8uUUBiQ=; fh=1YsjLisnvbBYy2s38x/1qEpWDj2wBmVp1e6G85da6JM=; b=XiH03aE6Z2/pHeX419D5/cGnrsf3yAhHswVt/oHiedTQuLOjKVP2d6MZJt/GMyrtUL Is4mDmb7IvUqxQasWA6WKgMfg8akfn6UwKejdoXg0fVK/7uMPG7V5vwUlv0Mlfet2p82 Y7xt46wPC1LzZ0qaP7CfigpaL5PhlXwR2W6SlaWQFBBkWnoBj6wnDygxnvz46iBoW5Yg DxJsPvdsqGM7kGtRs2nsJ6qt6XcTaXJGJkH0hpGFc20cjtXC/V295zgCJHcX7nbuBMHR ArTMwm6L8+5dTr/gsOW3sxd45B5HtuUGoqJWcsFmSregylZ0K3N77wb5If6K9Ss9QxAS qYAQ==; 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=1782818745; x=1783423545; 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=vpcwfF0FDeKVqrHhZmRHg18AUlXqi70eWXFt8uUUBiQ=; b=doHVU8ewrjUbQi2FVVA/0z1nZHGcLQ648bakiWlbqxFFhjqV6nmT0OYldzx3jofvTR LViGoFLEBYF3aECcy4e2Nk0Rdp63cNq0an4muZ778Xy0GYFKBiHQgLbmGU8hdNK+h7CF W5QIewjCGeUHejPrUNOMI9B6AGDgDe5+CLPsS2oGYfceuZ9eOo3DhjN2djb2Lb1NHKPL N8VynA+hhaGtgBF5l4lmKjxQ+6aDKUkGDTT/7txfMqkhynYDbfe8ymWhSMKxQf5QMk4g WD7sXdwzP/RDFAGnxCF6jX1y6Wbk7O3zH8u+NHwpD5xroDYkVHyIir3BlpgU9nDLux1I uUaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782818745; x=1783423545; 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=vpcwfF0FDeKVqrHhZmRHg18AUlXqi70eWXFt8uUUBiQ=; b=VClVycu8uRqEsWYMHSxJVGmouh8eR4s225ZJJbqe76g913L2OrLi5IkciwtyHyR9TK wopjywx8l73h21zcP8qV6RiNST63q89xGjdgwAYZua74NZGSdbIHlS1ZJyV8HZ3dHO5V JxUWNlB8HiLZzh3HQ/nnKhtfUb5FO/VKdsyrd6H1Crfh2AlzexNKhyRwyZ4ehzYU6eTy PCuNArv/mLOkYQDuNJBl83CdAW2oDhBfBief4pEMQq/MnWvKavD7BE1P9KG0i+t6p6Bb 6MCfwVbKUP/tHqjyzxMR1r+UVcIoxjvCS5uKxaaAxUJjp2weHY9QVymcAWHveLcizOaf 9kgg== X-Forwarded-Encrypted: i=1; AHgh+RpeT2r0hb3zQmjQhyi6q2ANSMez9oyhPx7f4vguQvVobauttDPIoPRWr4LVJ/a2tffjiM8bTUOINQMEJGkg@lists.postgresql.org X-Gm-Message-State: AOJu0YyfG/Nus6HmN8//HwP1CSWYQFbTEsydqyuBH0sJChx7igUVniNm rslMpNOKqIaiNr6lTHqOtThoxggpfgvAWRRWqfCuciVCBEBFrnN40L8D8exgC/ZlU5BJhnIf8+c BoO3ViZbKxTMFkpwtl6q5/KhNha9xXlw= X-Gm-Gg: AfdE7cnnhl1NqKLuPYst+7hmQXyiZ3fU6kvPyq2J4QfEJb7oOE5htJDqv7szuBV23++ zl0Mv70ifJTfiYOnESmNFe4sGr3GJeQf+3ni2XHUVb1slzM0mpIT3X/ZpVaDZMFTR7a/oDeRN6J k4p2BMazgAZbgpLVIpX3uaKf7ufc+B0r5eeju5Y/vmgsQZ1csa9TLlLhruCNGAmPIT9G+D14zfV V7VsLWZWQnAzXP7akoLy2iqZ4HNOPbXVUOxk/DDEinHD20L8mN992PPzuCwUEtipgWyjgSjE/A= X-Received: by 2002:a05:6402:3881:b0:698:7485:3f12 with SMTP id 4fb4d7f45d1cf-69887845d9cmr140270a12.24.1782818744428; Tue, 30 Jun 2026 04:25:44 -0700 (PDT) MIME-Version: 1.0 References: <232439a3-af7a-4a13-82ae-33da5520d4bf@postgrespro.ru> In-Reply-To: From: Pavel Borisov Date: Tue, 30 Jun 2026 15:25:31 +0400 X-Gm-Features: AVVi8CeA_2vEAN_CBThKB09KAXxqtmIyoId_3_RkKUt31CuD-mHvqOA81cM7H9c Message-ID: Subject: Re: Add SPLIT PARTITION/MERGE PARTITIONS commands To: Alexander Korotkov 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, Alexander! On Tue, 30 Jun 2026 at 15:07, Alexander Korotkov wro= te: > > 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 w= as > > > 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 one. > > > Current checks are made for this case. > > > > > > >- If there's *no* default partition, then I think the check should = be > > > >relaxed; it's sufficient to verify that the bounds of the merged > > > >partition do not overlap with any partition which is not being merg= ed; > > > > > > It's probably possible to do this. But in this case, the command will > > > 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." Regards, Pavel Borisov Supabase