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 1wd8Lx-003ubf-0u for pgsql-hackers@arkaria.postgresql.org; Fri, 26 Jun 2026 15:20:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wd8Lv-00BgLS-2Q for pgsql-hackers@arkaria.postgresql.org; Fri, 26 Jun 2026 15:20:23 +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 1wd8Lv-00BgLJ-0w for pgsql-hackers@lists.postgresql.org; Fri, 26 Jun 2026 15:20:23 +0000 Received: from mail.postgrespro.ru ([93.174.132.70]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wd8Ls-00000000NGH-1hHL for pgsql-hackers@lists.postgresql.org; Fri, 26 Jun 2026 15:20:22 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mx2023; t=1782487218; bh=SCdHaErHEhx1vVztWa+/y4fNpQRpJxdK5edGBJJgvM4=; h=Message-ID:Date:User-Agent:Subject:To:Cc:References:From: In-Reply-To:From; b=mZCPwWK9Xa/PRtRCDdjKZ8wmhO0rQ1JxdQrMrruxiZn0ZSeqot+GKc0SA+p0ZAwAR 6OPzGIGp4dboRfhPtESrzsutfs6I9LwMKlFjK8w8kdUnlhaEg5Zvm+IFh/g39Tvs1Z tdYVrNxMOHgc7etBLHxLjK+PkAEsFNb/ty1hp+TyQ4vDtylEURLyiBIfWiKfzEnFwI 0rFwFbArwLaBz5daErMV/bG1Ce1T1QS3fTp3jqz6qbXUVPtlxZWhhBAo9oTZCk5OF1 WVDVKNsFfhGaPtNd7qG38Ss2DhU29q+HjyLqr0RQX6IH3Cdt7o6BDZyrW5BoBNVV1p SPNby55enlreg== Received: from [10.9.2.97] (unknown [31.187.97.93]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: d.koval@postgrespro.ru) by mail.postgrespro.ru (Postfix/587) with ESMTPSA id 71D5660F40; Fri, 26 Jun 2026 18:20:18 +0300 (MSK) Message-ID: <232439a3-af7a-4a13-82ae-33da5520d4bf@postgrespro.ru> Date: Fri, 26 Jun 2026 18:20:18 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Add SPLIT PARTITION/MERGE PARTITIONS commands To: Pavel Borisov , Justin Pryzby Cc: pgsql-hackers@lists.postgresql.org References: Content-Language: en-US, ru From: Dmitry Koval In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-KSMG-AntiPhishing: NotDetected, bases: 2026/06/26 14:22:00 X-KSMG-AntiSpam-Interceptor-Info: not scanned X-KSMG-AntiSpam-Status: not scanned, disabled by settings X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 3.0.0.9059, bases: 2026/06/26 12:35:00 #28299329 X-KSMG-AntiVirus-Status: NotDetected, skipped X-KSMG-LinksScanning: not scanned, disabled by settings X-KSMG-Message-Action: skipped X-KSMG-Rule-ID: 1 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi! 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 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 merged; It's probably possible to do this. But in this case, the command will not exactly be "MERGE PARTITIONS" ("MERGE PARTITIONS & EXPAND"?). -- With best regards, Dmitry Koval Postgres Professional: http://postgrespro.com