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 1x4wHJ-007Voy-00 for pgsql-hackers@arkaria.postgresql.org; Fri, 11 Sep 2026 08:06: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 1x4wHI-00DA1Q-03 for pgsql-hackers@arkaria.postgresql.org; Fri, 11 Sep 2026 08:06:32 +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 1x4wHH-00DA0m-29 for pgsql-hackers@lists.postgresql.org; Fri, 11 Sep 2026 08:06:31 +0000 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1x4wHF-0000000477P-0kym for pgsql-hackers@postgresql.org; Fri, 11 Sep 2026 08:06:31 +0000 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-486e835acacso512746f8f.1 for ; Fri, 11 Sep 2026 01:06:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1789113988; x=1789718788; darn=postgresql.org; h=message-id:date:content-transfer-encoding:content-type:mime-version :comments:references:in-reply-to:subject:cc:to:from:from:to:cc :subject:date:message-id:reply-to:content-type; bh=uhmvg5y7tociW/ooVSI6JkTsa9fo5oWpkTzd3HlN7G8=; b=nJkdnQwxm/ZV4X5TaPUy/CirfdM8haCQLNriK4AGnfKCyl6G0KN//nFaKxOt0C7leB WpB3gUUTvhZ6qn7yDyDOViZ4XD2Ps/OiLJvl6m/l8kG4MUfBfcoo4pwPeg4YkBHwHwZR +W6JHQorctpUAwqt4yaNRiNE9wbf8MfjWKdjRkHZAzre26YGufURgQQEDSeBg0UhKGVI n0mhzAPSd4Lm0h2ObAF2ET4tYruiF1CzK4wSjYyV5lgPYd240zpTS7LuRKKLSq6UaI8e CC2RaRqBQeORqqvcvxqfVZsCWWG/BUPx9Afrehfe9hU6y9I9hw/2xrsfeJceGKbXf6aW 1Zdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1789113988; x=1789718788; h=message-id:date:content-transfer-encoding:content-type:mime-version :comments:references:in-reply-to:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=uhmvg5y7tociW/ooVSI6JkTsa9fo5oWpkTzd3HlN7G8=; b=k4pYZkJuYNKH2tPrft8kPMUaGxLH4z5sp8hcOU6C1kSVuWVOFlF2eeXmIlL+9Pe/5G 8GiIoAu6UTrssOPN2Cguf/xtjKNA2dEjHoJ8reeST0pZU5wG81cNLbBlab+UxlwcGaPd 7Lj8gUiK6HgBpZ4xpjtyjq/2etM3NSS3PbCl49NSFbFyFsMwBo+qw/UNy8M2BY99Ys4f GP4b4qNe2GiIREkdXmPMBgBf19oLor9JVZk0GXtrp4d0iRlvePskZgeLLdNF3vCbeoXF pErWhDMipdX7/EMnptkGU/iUouufCXDwTlDQEyZ7mWis92ul0+0klOlYLxEvJT2k82U/ hyLg== X-Forwarded-Encrypted: i=1; AKwUvBz+iILNxLLTNLE+alrPzHLE8QMy2TZtiM39KaRx5COULqmeheT3Fc9vxXGMeP7si7HzvomrjMEqVdRgbuiV@postgresql.org X-Gm-Message-State: AFuF++lcbXKuZ7QcwIoZC9b8OolxVtxt5rL+dDEnau4nRMvxrOe3xEM8 UZmlJRDOijU/HjfNQ+3shoNxhmEL7jEJayGatDZVBg7187meBDE8CMWfULbaWrSyMPA= X-Gm-Gg: AYBFou2YQ6N4mi+8D3DZb+zXQt41JniSifCdoJX5qJSwfre0n62KdjnJSXlOjc9ffur L9pADbhbaj2Sbqrac3JGQ2iW6fcC3CxgGT2c1j7GAINyuf2w0GRYQi8Hokxwbdgx8Fh9GzXtCd3 LDlIY79wZ+DI1hHB2E7zWlkbKpp1derq5S8TPTOLSgu/ZrSk9WaWczbh9EpDml9F3BTap1v4KqS 6uTZCNj4lp7CcCSQIQaJY9DKEdU5k6s5DXlqtb1Y3UjZtKMQN34FvlNF7pcuPkVWI4uZQztcPGd +1VkLSm+triruxrCGXJjH1Mkfn/Z/Apme9E4bnHENCaGjf2HqHBFrfoYzi9UGzFscGvzz1GEIMV xeMuz4pkjW7BMbuDjZrLuR+mU0F9zHK9dmG+ph3HT8fxhViA/wNfHWSCEWBFWH4B1wLhggossvH 7C1v8LFOqj2u5V3i5PNR28fLQ964h4SRu6kIK/59isE2rQxAMexZtm70ktsPGuCy+yOuyJ4hzYT DKSrKUDbYqq X-Received: by 2002:a05:6000:2005:b0:485:9c3e:fc1c with SMTP id ffacd0b85a97d-486eb2e3cd1mr3511085f8f.10.1789113987877; Fri, 11 Sep 2026 01:06:27 -0700 (PDT) Received: from localhost (109-81-170-190.rct.o2.cz. [109.81.170.190]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-486f0403125sm2041522f8f.8.2026.09.11.01.06.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Sep 2026 01:06:27 -0700 (PDT) From: Antonin Houska To: Chao Li cc: Alvaro Herrera , Matthias van de Meent , Nathan Bossart , pgsql-hackers@postgresql.org Subject: Re: REPACK (CONCURRENTLY) fails when replica identity index is dropped In-reply-to: References: <45513.1789063796@localhost> Comments: In-reply-to Chao Li message dated "Fri, 11 Sep 2026 09:42:15 +0800." X-Mailer: MH-E 8.6+git; nmh 1.8; GNU Emacs 28.3 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Fri, 11 Sep 2026 10:06:26 +0200 Message-ID: <10924.1789113986@localhost> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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 b= ack > > > 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 su= ch > > case, I tend to consider ERROR better response than broken replication. > +1 > > Actually, there was a similar discussion in [1]. In that case, the questi= on was whether setting a table to UNLOGGED should fail when the table is in= a publication=E2=80=99s EXCEPT list, or whether PG should silently remove = the table from the EXCEPT list and issue a notice to the user. Most people = in that discussion, including Amit, seemed to prefer failing the operation.= From a user-experience and design-consistency perspective, I think these t= wo cases are quite similar. >=20 > [1] https://postgr.es/m/CAA4eK1KHA-mkvtRPKsE-er8ePOnEu59_hxApaQKtr2=3D2GN= OEQA@mail.gmail.com I said "broken replication", but actually the missing replica identity index triggers error even on the *primary*: postgres=3D# delete from a where i=3D1; ERROR: cannot delete from table "a" because it does not have a replica ide= ntity and publishes deletes HINT: To enable deleting from the table, set REPLICA IDENTITY using ALTER TABLE. --=20 Antonin Houska Web: https://www.cybertec-postgresql.com