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 1uHiaF-0088Pe-Oo for pgsql-hackers@arkaria.postgresql.org; Wed, 21 May 2025 12:30:08 +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 1uHiaE-006Nl2-0y for pgsql-hackers@arkaria.postgresql.org; Wed, 21 May 2025 12:30:05 +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.94.2) (envelope-from ) id 1uHiaD-006Nku-Hn for pgsql-hackers@lists.postgresql.org; Wed, 21 May 2025 12:30:05 +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.96) (envelope-from ) id 1uHiaA-0008VI-0n for pgsql-hackers@lists.postgresql.org; Wed, 21 May 2025 12:30:04 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mx2023; t=1747830601; bh=vsSYEbVZOx3V8OLvsCn/a4aE0YaXxEf0QbjmjvKXoEA=; h=Message-ID:Date:User-Agent:Subject:To:Cc:References:From: In-Reply-To:From; b=BxjmPkN0UDBMO5qG0eR6gyvJx8D9wuSsyAhkK1YHeFCUh1288oQHjubMBX8bXeFso JrlDtDgDkHpygAQfbwF7kWYxG/VHBMgskgCAEy+QcX1RlFQ38/1Y8Dkv83blFmNRq6 jaUoK0expQzYRsB2Lvq5uZVyuEziRWXgbSietA9bIUFM4F+kgPL+KsWExvEu1WhUQ+ KaeNd1o7ylggkpykXBUByJ6R3iTx93dxkOZ5eYUYstrTUgYPVJeJ8KUSnS1mItO3IV 3GV/xky+dDRLUpH9JQ3CZO0RfE16EvYq+gjG5sXor/Ft28DZhqby29UuQijC2ivnZE POZDpMAUZbNJg== Received: from [172.30.48.122] (unknown [93.174.131.138]) (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 0EEE0608B3; Wed, 21 May 2025 15:30:01 +0300 (MSK) Message-ID: Date: Wed, 21 May 2025 15:30:01 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Add SPLIT PARTITION/MERGE PARTITIONS commands To: jian he Cc: pgsql-hackers@lists.postgresql.org References: <171085360143.2046436.7217841141682511557.pgcf@coridan.postgresql.org> <859476bf-3cb0-455e-b093-b8ab5ef17f0e@postgrespro.ru> <4e2764f7-f6be-478f-8d7f-f921dbd10f5f@postgrespro.ru> Content-Language: en-US From: Dmitry Koval In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-KSMG-AntiPhishing: NotDetected, bases: 2025/05/21 11:48: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 2.1.0.7854, bases: 2025/05/21 11:18:00 #27941800 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! >per https://www.postgresql.org/docs/current/sql-altertable.html >"You must own the table to use ALTER TABLE." >That means the current user must own the to be SPLITed partition. Last statement may be incorrect (if the logic is different). Current user can attach another user's partition. If current user can change (attach) another user's partition, why can't he split the partition? After attach, partition is part of current user's table, and current user can change his own table. (Moreover, the owner of the new partitions is the same as the owner of the split partition.) -- With best regards, Dmitry Koval Postgres Professional: http://postgrespro.com