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 1x4yKR-007XEt-0H for pgsql-hackers@arkaria.postgresql.org; Fri, 11 Sep 2026 10:17:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1x4yKQ-00DrHt-0K for pgsql-hackers@arkaria.postgresql.org; Fri, 11 Sep 2026 10:17:54 +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 1x4yK4-00DnKc-1l for pgsql-hackers@lists.postgresql.org; Fri, 11 Sep 2026 10:17:33 +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 1x4xCY-000000056eh-2WhT for pgsql-hackers@postgresql.org; Fri, 11 Sep 2026 09:05:43 +0000 Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46]) by mailfout.stl.internal (Postfix) with ESMTP id C91EE1D00113; Fri, 11 Sep 2026 05:05:41 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-06.internal (MEProxy); Fri, 11 Sep 2026 05:05:41 -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=1789117541; x= 1789203941; bh=iyJyC79vEXGW611jTArLm7x9Ut1nWwHFeQ/CJEqFi0A=; b=r HwLBlmXfIdatVZxMRBWDBLAcGV9nzOck77It8N8kPIgp7E3vriEs7YF5XlRcQtnb KteQJvC4VFfyKckpXPw5Uu10LcssS/OgJglow+XCz1warVohg0vRJajJ80x66ANp 7lvktbnqdEsdCponsgZPM7tO86cm+NUo106bBS/LiSE12EjHdmo9uGZYOEZ5v5H6 mChhurofGoP/vEAufWtYHBBm6UQrHs6SltHozQULnebjuVLjA0dauoDjUNKoLApy DdPK7vxYjtVcBdoTocHgMVPqV2V2snSFevw8J/lukgb1WAPGesDOjKIYUUo0iSP5 9Wj91xIsdRI3k6KEuY7mQ== 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=1789117541; x=1789203941; bh=i yJyC79vEXGW611jTArLm7x9Ut1nWwHFeQ/CJEqFi0A=; b=nxm+96UjBe/tc5WZc MBRrP4Ex4ktYXzyNIh7Y67XImsmHN5NNI8RVR9OHlP+wCm9O9OgaS1OGzzenxnjt sEmIS8afMlr85w9yhty7nSKjtI1nKrWLfsC+fPIQyoshMl9JrS872GouSLwmbUcC uyYmB53GXg1F4Mv8VNDKukv1pjklxjW0pfMQ1Q2CzVa/688TW4Km5XkkvY2MO/uw mrUoylry3LaEXIZunm2ZyJuwZJJ2Wrkh5XarOpdHmZDY/X/osEr5pFnMLYzGutwB ZwCE81FX49mK/1PFhXmKF3E4NDAUCOKmg4HBnuqDnO1KI/BwVmpaXD+fnFVQchZb vJfsA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTFkTrUfalE5f+PNMm72NXDxmtvlXQpe9oDujfhk7Oo5fWFjuQidMa1c3U2jYbWClA 5lLz7/dhssVGYAg+vlpovSjI4AzK0OyD4hSC1l52/hUnrRm4h8eEzG3nfMcQZqW/oz90BG 4aNYQNJitofGviGBWuVdXbk5lCK4nLXCUfus7PClZm9auJcEQIeaUAVxNNYh2Q5HWUuHAu FnyQlQyLNAQ+59XwjKVLSfMevlW8AA5G30MtvxgmuAGfIWt+ZZMlR89iAzqZXvuh6FzwY3 aPLjsJ6nyWow8ccNsD49FPoYu5PIinbdcI5a9hMSw3UuoyHckd1dAbPBmptsM7+mID18Tl i0dgHucKlqUu2SdIZTDZsRzDSadmqfhiQoHKjg5/XhCW+jjZgA5UPvDd9aEWxp3wv/pEg+ T45IIt4tQUSEvDRASDQj9J7+H0V3h0Lxz0jA1J8TwoxRPeotd6/2ljmMAoXmxSlG+1e4GT 0Y4UhTcUfEA9lJXe2njveez7wI9WjCtsSz0MV3LhyPwQbzmimqWSvMXJKbeM1uWOFne2Kt GF1unGmeHbzvWoSb+CJ9YHBUj+13ASa2L0+dUKeLKPSUrlHH3K9a4Scrzp+ZhjJ9WaK1Dn ybwqQpkTEbH/i4R/UQ+AeND+7wQJz+rULaHG7484t/RvxOP4NlIFuuLAgnkw X-ME-Proxy: Feedback-ID: ie3de48e3:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 11 Sep 2026 05:05:41 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kurilemu.de; s=schmee; t=1789117538; bh=7wA5n7lgoVAkiU6FxpXb+XHVY2Qh+UjJ2pio1EFIYNA=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=NxacNSnfnaANaG/pGiozcmi4EZOWIPyqCPjDUOmF+SOf7KiQC3mLU/qY+Fv845H3y Dp6PmGDeaxvGyqqK4xaAHFHhTccjNJpuHZ2LhzyeX5KIRkOBM6/2BNxgk6O1pDZJYa ElFaMlCuAc5tqDPuMPuqpvlmNIkCdhGVfgatE0TQPY1nDSrymjEVB6U/2uB/KgLoFm HFlgLU0r0d6jYYP26zrdBuG4vlRMuQZIBzZczE5OZLcMC0X0LV4LkiyQt9WWwRUy2i ovXd97snkmYFzajghfJKJhwur2lmNfkffBFmhercP8W+8sHUqPwnUvJdYDfnJnzJ2h 0mlLLvMPlifRA== Received: by ida.kurilemu.internal (Postfix, from userid 1000) id 0FFBAB00039; Fri, 11 Sep 2026 11:05:38 +0200 (CEST) Date: Fri, 11 Sep 2026 11:05:38 +0200 From: Alvaro Herrera To: Antonin Houska Cc: Chao Li , Matthias van de Meent , Nathan Bossart , pgsql-hackers@postgresql.org 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: <10924.1789113986@localhost> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2026-Sep-11, Antonin Houska wrote: > Chao Li wrote: > > > On Sep 11, 2026, at 02:09, Antonin Houska wrote: > > > > Alvaro Herrera wrote: > > > > > > > Actually, wouldn't it make more sense to reset the replica identity back > > > > to 'd' when the index is dropped, as in the attached patch? > > > > > > Even though users probably do not drop the identity index too often, I think > > > it's possible that someone tries to drop an index that seems to be > > > unnecessary, but forgets that it's in use by logical replication. In such > > > case, I tend to consider ERROR better response than broken replication. > > > +1 I can't really disagree with this argument, but sadly, due to the way object drop works, this is tough to implement. If I simply throw an error in index_drop(), all manner of things are disallowed: most curious is probably ALTER TABLE .. SET DATA TYPE on a column of the replica identity, because that wants to transiently drop the index so that it can be recreated. But of course the worst is DROP TABLE: because each individual object deletion is carried out oblivious of every other object deletion, we don't _know_ that the table containing the replica identity is _also_ being dropped, so we raise an error when the replica identity index is dropped and the whole DROP TABLE fails. Maybe a way to do this would be to hack reportDependentObjects() to see if a replica identity index is in there, and abort the drop if the table is not also being dropped. (That doesn't fix the ALTER TABLE TYPE problem though). This sounds too invasive to consider at this stage of the cycle. Going forward in pg20 we should try to implement something like that, but it doesn't seem a good way to close the open item. Maybe it's better to go back to Matthias original fix proposal instead, or Ewan Young's variation thereof. -- Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/ "El número de instalaciones de UNIX se ha elevado a 10, y se espera que este número aumente" (UPM, 1972)