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 1x4zke-007YA6-29 for pgsql-hackers@arkaria.postgresql.org; Fri, 11 Sep 2026 11:49:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1x4zkd-00EMlk-1Z for pgsql-hackers@arkaria.postgresql.org; Fri, 11 Sep 2026 11:49:03 +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.96) (envelope-from ) id 1x4zkc-00EMlc-2C for pgsql-hackers@lists.postgresql.org; Fri, 11 Sep 2026 11:49:03 +0000 Received: from fout-b7-smtp.messagingengine.com ([202.12.124.150]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1x4zkZ-000000048oW-0aYM for pgsql-hackers@postgresql.org; Fri, 11 Sep 2026 11:49:02 +0000 Received: from phl-compute-04.internal (phl-compute-04.internal [10.202.2.44]) by mailfout.stl.internal (Postfix) with ESMTP id 56C321D00091; Fri, 11 Sep 2026 07:48:56 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-04.internal (MEProxy); Fri, 11 Sep 2026 07:48:56 -0400 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=fm2; t=1789127336; x= 1789213736; bh=mvi1Vrrui7BGb7DkuYfSHc2YlVL7ZIBHm5D4MlxrA08=; b=a 8dnMVlWF6g+V3QOeW9zvi6UuRKldO03fcwQKdS/kYmZ8hWfFoSrKq3O3Yotw2xR0 AyTqlFbOBYFPn8he8Xzfq3gvzTlGyUpOcwxNtEonYnce2ep8EgDvTd6iPwcY/Yzl IPNqZ9vc1xrWNreP/TGovdg/RYkIE3GruSq3yVxnNZsqKOYDwINeHl10159wcyw0 P+qkSEBaGvgB4ryxldbqc5A6Z6sQjP1qW4y6kgpdZvgNd28mNIb34ziZ2bZxNAaD GJtkDc5MF8Uc+9ZzMHe5WUWg9I+7jxhM2UtdW07l0SQqMfcEHliA+Eb9Ox6Zqf6v WtuVkdRwphhfOTSx1Xnjw== 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=1789127336; x=1789213736; bh=m vi1Vrrui7BGb7DkuYfSHc2YlVL7ZIBHm5D4MlxrA08=; b=fEQdT8a4iFcLQyzMk 8XIAvLWX25xPgsK2TSVpxwGsJjrz4HrHT/hU/GXmVzpwns2JpDwUJA92rRKrb9cs 4C/rlkjbY+8dRG/TqalgkEgsETaSMR/oMzgX0reNPeR2MfQ/mLhPP07XsczgecOS yc9RjC68L9gaeSbsbkwL32a4U/DShCpjXTRnaWGa1XILxYgAjXswdNR8oDGfytqH yJQ33VCFZDTnKia+lCUuKOUvE82kS06/1We3tGYfP2XINKY/A3+nATRk4SJ29UAj hk77OqXLQhqO+bQMNnBIxvrU/adKgOGXLZmiAPdQ2QPbjVifVkiRcfd532epwaqw WIOXQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTF6aWaDF6nWjJ1S0axDwci4XrD21FmfqgaQHHLv5zd/Y9WCfLUu3qphmGNrTh9JpP IAwffDc5G9G/bqj8JAVkiSZuv5xp+2cReuzleuGqAiBIuNOS4+Aq8r69AyiedM90Ol0j5v XSlInJBCpe1+CHHUmbSrp8FAx5aKdrkg0+EByT4kFf9DeOEINdoHYgvXcnMRUIJv38vZZN GgTUxRkzFilWWB2a0H5pwF0eReQ1OnWhsT3+bOZcIDPSAYCfB4Nk44YJlGWe4+068jC+8r BsHYKYeI/WcIpIVXawvFHqA6ic8VhO/BkEadYYb1bRdSbaed4ingtvqziWqPAw2YiKLSrL hg3OAP2KboVODs+/4kEzojdA0WxzyYGUolHVLL2RwUO+/tZxuiBv+VwMyvj25wh78CPehw QR2PG1pNI66qgbPzKJxVKZHZAapl74o+5zH6o8YxWIyf4zXjJRd2SoPimBwgV5/ieYWUR0 JFU/0XUwIx8d5GZsHPtutDOc8kCTLVgQnCM9ir1ey/05C+VUd6bLFt+kuaTlP4qFTIG8f0 I1Ib5uIymf34EOEK0ne+iU//G5TvIg+6k/EZSu//IePvMs8wO0NMzsk/KK6iawvBs22pNy 8ll0rlXCWNBNiST7wnargm5PvKqtBbIodcx53Zc7gs4GrIeL06iyB0iWwJOg X-ME-Proxy: Feedback-ID: ie3de48e3:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 11 Sep 2026 07:48:55 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kurilemu.de; s=schmee; t=1789127333; bh=y8/9taYPr/CWGeSnsGhhF10f2SaKJQ4exrqmxVlyW00=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=EW0ffFYKM9XRal2JAi+Kmv4swNONVV/+C0mJ4cdDlGQ6W74cwQ2WvptCEeEut4FGe DX9xQ37K3yn7acyayFLMFA+YWJ+gxxrwmHT27aEJGgNMsRPBgXWhhv51jEpSF8X5/4 qjx/zx6v1BN+0kegzn5SOE5L7gACxaozqOSqFvTcViQzNuO5R4rkYFb0y4GM7GGbnu UWrdUbWcg/vKuFO7ZEJ/xJsboaCxGlicGdS1iF/iNf5ynBVGOWx3E9NpXDBpBsmlu4 RivVOM47FIacQ8MQ3hnU9IfmbS9uxp65p8rQbQfiwA+ejNqpIgra0BQtkwluzqhStC DtLPeEc/jE2Ew== Received: by ida.kurilemu.internal (Postfix, from userid 1000) id 89467B00039; Fri, 11 Sep 2026 13:48:53 +0200 (CEST) Date: Fri, 11 Sep 2026 13:48:53 +0200 From: Alvaro Herrera To: Ewan Young Cc: Matthias van de Meent , Nathan Bossart , pgsql-hackers@postgresql.org, Chao Li Subject: Re: REPACK (CONCURRENTLY) fails when replica identity index is dropped Message-ID: 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 2026-Aug-28, Ewan Young wrote: > Thanks for digging into this. I agree with the direction of v1: the check > should use RelationGetReplicaIndex() so it matches what logical decoding > actually requires, rather than GetRelationIdentityOrPK(), which falls back > to the primary key while decoding does not. That mismatch is exactly what > lets a table with a since-dropped REPLICA IDENTITY USING INDEX slip past the > check and then fail during catch-up with "incomplete delete info". Right, thanks for the analysis. I agree with this fix (and I can confirm that an isolationtester spec for the scenario reproduces the issue as Nathan reported and no longer does anything weird after the fix), so I have pushed it. I threw in a test case that verifies that the sequence is rejected. Now, IMO the behavior of RelationGetIndexList in this regard is broken: I think it should set up the PK as replica identity when it's been set to an index which no longer exists. That allows this to work correctly, and I can see no downside, but didn't spend too much time on that. I'm not going to propose changing that in pg19, though. We could also entertain the idea of switching relreplident back to DEFAULT or just failing the DROP INDEX outright, but of course only for pg20. Thanks! -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/ "El destino baraja y nosotros jugamos" (A. Schopenhauer)