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 1vTmti-00BAQt-1L for pgsql-hackers@arkaria.postgresql.org; Thu, 11 Dec 2025 20:04:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vTmtg-00556M-2M for pgsql-hackers@arkaria.postgresql.org; Thu, 11 Dec 2025 20:04:21 +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 1vTmtg-00556E-0T for pgsql-hackers@lists.postgresql.org; Thu, 11 Dec 2025 20:04:21 +0000 Received: from fhigh-b8-smtp.messagingengine.com ([202.12.124.159]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vTmtf-000C8E-0X for pgsql-hackers@postgresql.org; Thu, 11 Dec 2025 20:04:20 +0000 Received: from phl-compute-07.internal (phl-compute-07.internal [10.202.2.47]) by mailfhigh.stl.internal (Postfix) with ESMTP id 8B6757A009B; Thu, 11 Dec 2025 15:04:17 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-07.internal (MEProxy); Thu, 11 Dec 2025 15:04:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kurilemu.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 :reply-to:subject:subject:to:to; s=fm3; t=1765483457; x= 1765569857; bh=LZQKkuWQuKTbk+jFHiShYZb4OvxVYG/PzYAEMXKOlQg=; b=P s8g8XQybpsw6m4p7lzdp39tm88Wu3AM3LWaEfIUAosDis2Teazz5HBieYcgmiUAI ruJoR4kQgqrEyLw2BDhQ3ScMd93U5rsFSu5meevz/8wihab2WhAmUp6e3Nk4nV1T xwwaW1MSb4znYBcwDVU1H2Q148QEuuad8IfAvgsEVXRow0m8q8Xq9aE3ntEQfovj NmLQEEjrd5Bkk8hdzGsk9gOnnKtBsco7r2o6CEo9TIk5NWeVa0WXTJktv1eU2GcV KdRxJuM4Sd6W5CusXPqNYlEcN6Zr94b14eKLvmCYrnb9gAGKOk3d0YDxck8cBz3Z JTJ79CBYtVHCxFVNdL8+Q== 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 :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; t=1765483457; x=1765569857; bh=L ZQKkuWQuKTbk+jFHiShYZb4OvxVYG/PzYAEMXKOlQg=; b=vd0SJcCKLXs+oOjmp pK1C7DAjy74UWGTfLmqPW1BrIldP5yUPn22DpLUnr7uUIN/27ix+66PuR59aBTie 0lkN/xu/s7CFduVKGvB0wdDg/tCmBejGP70mNACiktFbXCFDq9lKjKMf+/OZr+iJ 0+sUa6PvsqqUAeQvO5oXxKf7gcEboS/bpq1li+qf4JNWQKusmODnuDk/8NfH/uCg CJiYGNHcxZgrFnHYlux6vuFdRm4ArDAxjz6mRUEZhLa6mTlwqIuIjsLFr2R0+jyA p20bypspis7hn579d2JiEDp2NzUQ1L5Cjj2gyQ5aTCKgAKvrsVewdKEKGBP3qd8Q inm5g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgddviedvvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpeffhffvvefukfggtggugfgjsehtkeertddttdejnecuhfhrohhmpemllhhvrghrohcu jfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgeskhhurhhilhgvmhhurdguvgeqnecuggftrf grthhtvghrnhepvefggefhhefggedvueffieffudeftdelheeuudettdffgeeffeeugfdv leeftdfgnecuffhomhgrihhnpehpohhsthhgrhdrvghspdgvnhhtvghrphhrihhsvggusg drtghomhdpthifihhtthgvrhdrtghomhenucevlhhushhtvghrufhiiigvpedtnecurfgr rhgrmhepmhgrihhlfhhrohhmpegrlhhvhhgvrhhrvgeskhhurhhilhgvmhhurdguvgdpnh gspghrtghpthhtohephedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepvgigtghl uhhsihhonhesghhmrghilhdrtghomhdprhgtphhtthhopehmihhhrghilhhnihhkrghlrg ihvghusehgmhgrihhlrdgtohhmpdhrtghpthhtohepnhhorghhsehlvggruggsohgrthdr tghomhdprhgtphhtthhopehmihgthhgrvghlsehprghquhhivghrrdighiiipdhrtghpth htohepphhgshhqlhdqhhgrtghkvghrshesphhoshhtghhrvghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: ie3de48e3:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 11 Dec 2025 15:04:16 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kurilemu.de; s=schmee; t=1765483455; bh=/c/6rZCGZrAofpx43o2YpkZEkcsFaYc0wLt17aVb61k=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=Z31zSzrjc6VkKo1Za8dYlNtHAPTj7SR/BvfIcxoXK3qRCctiapgoTKi7wSyKyQwsy hedrpdIklcC+bXXLGpSn+QHuEEdXlpsMLIOGwytDp3vkODxtjl0KaUAKI27wvO7Lc3 u39ilaFa8Qf0L+ow/VaQ0oKuZUOlReJApHw1/prt+HI014ALgqi/BBnHO6Y56YXmg6 317aSB+PoyHAiPPlWVD9vwjxWLjmgwhVnB+DmynakcfbcnvWqQ+b9+I8sKgOlpGrTN HyPMqXmsV3v5CVUqaseOtTXgITBrM3vCsETMUBc09EU6si6/zpF0cM3cQNHhsb4KvD /hdjQDiM8NHHw== Received: by schmee.kurilemu.internal (Postfix, from userid 1000) id 1280F78; Thu, 11 Dec 2025 21:04:15 +0100 (CET) Date: Thu, 11 Dec 2025 21:04:15 +0100 From: =?utf-8?Q?=C3=81lvaro?= Herrera To: Mihail Nikalayeu Cc: Alexander Lakhin , Michael Paquier , Noah Misch , PostgreSQL Hackers Subject: Re: Issues with ON CONFLICT UPDATE and REINDEX CONCURRENTLY Message-ID: <202512111958.6ymanstmexrk@alvherre.pgsql> 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 On 2025-Dec-09, Mihail Nikalayeu wrote: > Hello! > > After some investigation I ended up with a much simpler fix. > It is self-explanatory in code and a commit message. Yeah, that makes sense. It's what I was trying to say in https://postgr.es/m/202512072050.hcyysny65ugj@alvherre.pgsql Pushed your patch, thanks. I still wonder if it's possible to break things by doing something like CREATE TABLE pt (a int) PARTITION BY LISt (a); CREATE TABLE p1 PARTITION OF pt FOR VALUES IN (1); CREATE TABLE p2 PARTITION OF pt FOR VALUES IN (2); CREATE UNIQUE INDEX pti ON ONLY pt (a); CREATE UNIQUE INDEX p1i ON p1 (a); CREATE UNIQUE INDEX p2i ON p2 (a); ALTER INDEX pti ATTACH PARTITION p1i; and then do the INSERT INTO pt VALUES (1) ON CONFLICT (a) DO NOTHING; dance concurrently with ALTER INDEX pti ATTACH PARTITION p2i; This would be a much smaller problem than the already fixed ones though, I think. Thanks! -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/ "Learn about compilers. Then everything looks like either a compiler or a database, and now you have two problems but one of them is fun." https://twitter.com/thingskatedid/status/1456027786158776329