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 1wAq8S-000Qvg-2N for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Apr 2026 14:13:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wAq8Q-005wv7-2a for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Apr 2026 14:13:31 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wAq8Q-005wuz-1c for pgsql-hackers@lists.postgresql.org; Thu, 09 Apr 2026 14:13:31 +0000 Received: from fout-b1-smtp.messagingengine.com ([202.12.124.144]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wAq8P-00000000AuT-1oyb for pgsql-hackers@lists.postgresql.org; Thu, 09 Apr 2026 14:13:30 +0000 Received: from phl-compute-05.internal (phl-compute-05.internal [10.202.2.45]) by mailfout.stl.internal (Postfix) with ESMTP id E03501D001B1; Thu, 9 Apr 2026 10:13:27 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-05.internal (MEProxy); Thu, 09 Apr 2026 10:13:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1775744007; x=1775830407; bh=wBVpxa8aVa2De3+7WK2o9PPVZ6h+lu/ugyvds0MwAzU=; b= JYOZZcV1h4ExANsvvqHHWAE+GHymKQkP4/6l+Ftpa5aoj6dGTKkJ2WSyCwz7Z+5P JBdGvbsBF+EYs1ZHJbvZDamIUQWULKQ6Ixz7UQmgmXte960idLyPBfqGSDsnjMPU ZGriXtHqmdOTQh5gvI5UiSraEUuosva/5NjHiUwgnNU/0P2dO2VULLQYZwKNtp7u ZY1GdE0SmHGbeijPQx2RXPA4yxGVoFQwukfFD6qcFIkxRUbTR8J5tWOYqGDXXKFi XbEZ6IIk6pAw24e5gQparbPpg5pfg5q/hkJhUcvDstUnH53YHpCs7w85pEkvJztw Uac3Mc5n1AH7Vlnr+9P9hg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1775744007; x= 1775830407; bh=wBVpxa8aVa2De3+7WK2o9PPVZ6h+lu/ugyvds0MwAzU=; b=u iGSycH3QkPjvC4pXodgHCg6p1XwKKps+o3Jgl1D0ZaZBxzoCEdAhsmUChAootwfq 1qcanQtZp+eikj6c9nbdutmwHxm6iQ8lCcVF2pjL+jtBmeAzCK9bojKtYGgufIyd OHmCmpBx1FJL1g2S4qf44EgXhKf4P6H6YBDIB2w5wrff4nx6xvW2TdRcsNgYE5B+ PqQRku5DyZH/DSdEP26ppYYAbiH69O6YiC9fhJfBtJuqwmvNG2qBF70wxcc2F4M6 hfzS+jOpD+U9amQj4CmKV+W5BSOZ7n6AmrKddf2nwDe42+/5pQyuleZo3fpXxWC3 s2zGjT6efnj1OYt6b7qRA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefhedrtddtgddvieeilecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpeffhffvvefukfhfgggtugfgjgestheksfdttddtjeenucfhrhhomheptehnughrvghs ucfhrhgvuhhnugcuoegrnhgurhgvshesrghnrghrrgiivghlrdguvgeqnecuggftrfgrth htvghrnheptdelledvgfejvdffieeukeefueelfffhgeffhffgffekveeuheeihefhiefg hfdvnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprg hnughrvghssegrnhgrrhgriigvlhdruggvpdhnsggprhgtphhtthhopeekpdhmohguvgep shhmthhpohhuthdprhgtphhtthhopegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprd horhhgpdhrtghpthhtoheprghhsegthigsvghrthgvtgdrrghtpdhrtghpthhtoheprghm ihhtrdhkrghpihhlrgduieesghhmrghilhdrtghomhdprhgtphhtthhopegsohgvkhgvfi hurhhmodhpohhsthhgrhgvshesghhmrghilhdrtghomhdprhgtphhtthhopehmihhhrghi lhhnihhkrghlrgihvghusehgmhgrihhlrdgtohhmpdhrtghpthhtohepshhrihhnrghthh dvudeffeesghhmrghilhdrtghomhdprhgtphhtthhopehpghhsqhhlqdhhrggtkhgvrhhs sehlihhsthhsrdhpohhsthhgrhgvshhqlhdrohhrghdprhgtphhtthhopehrohgsseigii hilhhlrgdrnhgvth X-ME-Proxy: Feedback-ID: id4a34324:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 9 Apr 2026 10:13:27 -0400 (EDT) Date: Thu, 9 Apr 2026 10:13:26 -0400 From: Andres Freund To: Mihail Nikalayeu Cc: Amit Kapila , Alvaro Herrera , Antonin Houska , Srinath Reddy Sadipiralla , Matthias van de Meent , Pg Hackers , Robert Treat Subject: Re: Adding REPACK [concurrently] Message-ID: References: <202604062213.cgo352cdsgsm@alvherre.pgsql> <4n4q3preb3lgyhpzstebhux7b2aojhsw7gik4ivaznyggiezrs@lrznutssxlh2> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 2026-04-09 01:36:00 +0200, Mihail Nikalayeu wrote: > Hello, Andres! > > On Wed, Apr 8, 2026 at 7:22 PM Andres Freund wrote: > > I don't think this is a viable path. You need to prevent any further lock > > acquisitions on the relation to be able to swap it, not just conflicting DDL. > > AFAIU, Amit's main idea is that we currently upgrade the lock instead > of **releasing and re-acquiring** it because we fear DDL between those > actions. I got that, I just don't think it's going to work in any sort of way reasonably well. The fix here should be to make the system understand how to make lock upgrades as safe as possible, not to hack around the corners. For that you need to teach the deadlock detector about all of this properly. > > I don't think CheckTableNotInUse() would work anyway - don't we already hold > > locks by the point we call it? > > Yes, the DDL session already holds locks by the time > CheckTableNotInUse is called - but is that really the problem? They > will be released on error. There's no guarantee they get there if it's done after the lock acquisition. It can be part of a more complicated lock cycle. Greetings, Andres Freund