Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lehrS-0004nr-6n for pgsql-hackers@arkaria.postgresql.org; Thu, 06 May 2021 17:32:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lehrQ-0005h2-UL for pgsql-hackers@arkaria.postgresql.org; Thu, 06 May 2021 17:32:28 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lehrQ-0005gt-Md for pgsql-hackers@lists.postgresql.org; Thu, 06 May 2021 17:32:28 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lehrA-0005ej-Vb for pgsql-hackers@lists.postgresql.org; Thu, 06 May 2021 17:32:27 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 261ED5C0068; Thu, 6 May 2021 13:32:12 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Thu, 06 May 2021 13:32:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=jLQa6zyTNUuFzc6SsWISOa5qLUT2f6p7VS0mpVCGXrg=; b=FJqqXE9I WpEuNTLA3CwImDvauRtrbQjmfe/wZ1sRgiess6L9lgnf+DUVf4b/ZC1VCoVZN4DL 39y3+nt0qOqAYXlgw7hE/pq6Gadbhsbu6P8NHYnLhBjcqgjOl2cIHeM1cHuWWqSd IdXtzV+x5B9SAuDuuU9jmWMrgtYKkQIEaiC92jY56hM57N9GiYPsOlhCI4tyTVea yCo8T4UaOcTWKkiwH0JY92HA+0uifgX7uQr/kksqM/E+Yy6Zc785udVOF8JjdDFi ftnKE56ei7PfQKoUCQlz1aY38RvSeqNGjEzjigio6bGUVKFNrTrt7r7SYGpZp78c CWadVxsIkMVfcw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvdegtddguddugecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvuffkgggtugfgjggfsehtkeertddtredunecuhfhrohhmpemllhhv rghrohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorh hgqeenucggtffrrghtthgvrhhnpeetgfdvvedvleeuhedtieduuddtjefghfffudegvdek ffdvkedtkeffueeukeevfeenucfkphepudeltddrleehrdduledrleehnecuvehluhhsth gvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlvhhhvghrrhgvsegr lhhvhhdrnhhoqdhiphdrohhrgh X-ME-Proxy: Received: from perhan.alvh.no-ip.org (unknown [190.95.19.95]) by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 6 May 2021 13:32:10 -0400 (EDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 6C7FE2A0BC3; Thu, 6 May 2021 13:32:08 -0400 (-04) Date: Thu, 6 May 2021 13:32:08 -0400 From: =?iso-8859-1?Q?=C1lvaro?= Herrera To: Pavel Luzanov Cc: Amit Langote , Justin Pryzby , Tom Lane , "pgsql-hackers@lists.postgresql.org" Subject: Re: ALTER TABLE .. DETACH PARTITION CONCURRENTLY Message-ID: <20210506173208.GA29458@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <0688e7c3-8bc8-a3e4-9d8e-3bcbbf3e1f4d@postgrespro.ru> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2021-May-05, Pavel Luzanov wrote: > Hello, > > I found this in the documentation, section '5.11.3. Partitioning Using > Inheritance'[1]: > "Some operations require a stronger lock when using declarative partitioning > than when using table inheritance. For example, removing a partition from a > partitioned table requires taking an ACCESS EXCLUSIVE lock on the parent > table, whereas a SHARE UPDATE EXCLUSIVE lock is enough in the case of > regular inheritance." > > This point is no longer valid with some restrictions. If the table has a > default partition, then removing a partition still requires taking an ACCESS > EXCLUSIVE lock. Hmm, are there any other operations for which the partitioning command takes a strong lock than the legacy inheritance corresponding command? If there aren't any, then it's okay to delete this paragraph as in the proposed patch. But if there are any, then I think we should change the example to mention that other operation. I'm not sure what's a good way to verify that, though. Also, it remains true that without CONCURRENTLY the DETACH operation takes AEL. I'm not sure it's worth pointing this out in this paragraph. > May be make sense to add some details about DETACH CONCURRENTLY to the > section '5.11.2.2. Partition Maintenance' and completely remove this point? Maybe you're right, though. -- Álvaro Herrera 39°49'30"S 73°17'W "Las mujeres son como hondas: mientras más resistencia tienen, más lejos puedes llegar con ellas" (Jonas Nightingale, Leap of Faith)