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 1lPUKV-0002iy-F7 for pgsql-hackers@arkaria.postgresql.org; Thu, 25 Mar 2021 18:03:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lPUJy-00039G-Ee for pgsql-hackers@arkaria.postgresql.org; Thu, 25 Mar 2021 18:03:02 +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 1lPUJy-000398-88 for pgsql-hackers@lists.postgresql.org; Thu, 25 Mar 2021 18:03:02 +0000 Received: from [66.111.4.26] (helo=out2-smtp.messagingengine.com) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lPUJv-0000gM-1a for pgsql-hackers@lists.postgresql.org; Thu, 25 Mar 2021 18:03:01 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 266FA5C00A4 for ; Thu, 25 Mar 2021 14:02:48 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Thu, 25 Mar 2021 14:02:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=c0a+9D t+MXI5ToQTbUzcj9yWdhplQeXDH7tCnW8jfdg=; b=R0t1KG5OeyjK8F/dJ7C23g G4dIo6TsjlXp5zeg1vJjf0OopTYGzXNNIYfv8KtrVnL8EbdtbLQ3cH1pAUSUjacx K/B8MlbSVVIIdpuGDvT6B8uWjsiJ2RXOJuO6aY2RhZBLKXMiErqh9jyAaq3Z7oFX vUmUZaRAQPH2mHn/3iUvZeXaCkKr0+OnHGHWoHa8+vVt56Mns718IfZDzYNkYffe hX1rDwQR4d7QgeGcBTacnWLylIX7e1cJWG2VX4P5Z7YN0+mvmSXRcNkJ7DSzWRTf xL8OKi1m4yadNygLVxsy7L84O+MKh0ON8V1WM2cEis8AVpLMga0t/AkmjkSKTakQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudehtddguddtlecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvuffkgggtugfgfgesmhekreertderudenucfhrhhomheptehlvhgr rhhoucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh eqnecuggftrfgrthhtvghrnhepgeegfedvveduheeiteehheeiudefhfehvdevuefhhedt feelgeeujeeiueegiedvnecuffhomhgrihhnpehhrghtvghsqdhsohhfthifrghrvgdrtg homhenucfkphepudeltddrleehrdduledrleehnecuvehluhhsthgvrhfuihiivgeptden ucfrrghrrghmpehmrghilhhfrhhomheprghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiph drohhrgh X-ME-Proxy: Received: from perhan.alvh.no-ip.org (unknown [190.95.19.95]) by mail.messagingengine.com (Postfix) with ESMTPA id C17FC1080064 for ; Thu, 25 Mar 2021 14:02:46 -0400 (EDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 3832D2A0FC3; Thu, 25 Mar 2021 15:02:44 -0300 (-03) Date: Thu, 25 Mar 2021 15:02:44 -0300 From: Alvaro Herrera To: Pg Hackers Subject: document lock obtained for FKs during detach Message-ID: <20210325180244.GA12738@alvherre.pgsql> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="wRRV7LY7NUeQGEoC" Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.10.1 (2018-07-13) X-Host-Lookup-Failed: Reverse DNS lookup failed for 66.111.4.26 (deferred) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --wRRV7LY7NUeQGEoC Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit I failed to document the lock acquired on tables that reference the partitioned table that we're detaching a partition from. This patch (proposed for backpatch to 12, where that feature was added) fixes that problem. Noticed the omission a week ago while working out some details of concurrent detach. -- Álvaro Herrera 39°49'30"S 73°17'W "It takes less than 2 seconds to get to 78% complete; that's a good sign. A few seconds later it's at 90%, but it seems to have stuck there. Did somebody make percentages logarithmic while I wasn't looking?" http://smylers.hates-software.com/2005/09/08/1995c749.html --wRRV7LY7NUeQGEoC Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0001-Document-lock-obtained-during-partition-detach.patch" From 98c0fe1d22333ea4ec27256f9c4dda98b1166b65 Mon Sep 17 00:00:00 2001 From: Alvaro Herrera Date: Thu, 25 Mar 2021 14:53:21 -0300 Subject: [PATCH] Document lock obtained during partition detach We acquire a SHARE lock all table that reference the partitioned table that we're detaching a partition from, but failed to document this fact. My oversight in commit f56f8f8da6af. Repair. Backpatch to 12. --- doc/src/sgml/ref/alter_table.sgml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/src/sgml/ref/alter_table.sgml b/doc/src/sgml/ref/alter_table.sgml index 0bd0c1a503..cd56d6a17e 100644 --- a/doc/src/sgml/ref/alter_table.sgml +++ b/doc/src/sgml/ref/alter_table.sgml @@ -962,6 +962,8 @@ WITH ( MODULUS numeric_literal, REM ties to the table from which it was detached. Any indexes that were attached to the target table's indexes are detached. Any triggers that were created as clones of those in the target table are removed. + SHARE lock is obtained on any tables that reference + this partitioned table in foreign key constraints. -- 2.20.1 --wRRV7LY7NUeQGEoC--