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 1x4jDm-007LU2-25 for pgsql-hackers@arkaria.postgresql.org; Thu, 10 Sep 2026 18:10:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1x4jDl-008G81-1u for pgsql-hackers@arkaria.postgresql.org; Thu, 10 Sep 2026 18:10:01 +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 1x4jDl-008G7t-0d for pgsql-hackers@lists.postgresql.org; Thu, 10 Sep 2026 18:10:01 +0000 Received: from mail-wm2-x10.google.com ([2a00:1450:4864:31::10]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1x4jDi-000000040PP-3Iqz for pgsql-hackers@postgresql.org; Thu, 10 Sep 2026 18:10:00 +0000 Received: by mail-wm2-x10.google.com with SMTP id 5b1f17b1804b1-49b91369ef6so933495e9.1 for ; Thu, 10 Sep 2026 11:09:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1789063797; x=1789668597; darn=postgresql.org; h=message-id:date:content-transfer-encoding:content-id: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=ShhKbCx/ZQLQvu9I5jI+KYLVS54kDq+9Cw4yYomCOFU=; b=YyhzeNmbk596R8jOByF2MzUXOeIft0ZJ59Vxt6bbTm27oPMCeMVVs+6yTiHQBw2Zme 59ByY/AsorH6u4BTUvPCYDvUik/wEC3gqyM5PQhZfCr57pzVkdcv3XYY08+SfxPL0f2A qroEbrbmUrASWIMlzEnFomGC5xLnrtNLV33GkDrhgwSmuG5roFN+3aEB4hQz234X3WIT dbgnYe3CtT887XvxlkkTiet5hXl715JhKS0LaJIgx+al3Lz+LffAgNG06U/ts281y3mG R9mSzWM39/o6VWIvtY1pLt/1eaWovx+P1X2OdxzLb2Vpr3GAW01DAJRaGILN+OACMTIY SLtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1789063797; x=1789668597; h=message-id:date:content-transfer-encoding:content-id: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=ShhKbCx/ZQLQvu9I5jI+KYLVS54kDq+9Cw4yYomCOFU=; b=MLCnusicnu0nVik6Kh7rS2OplBAAa2LeahESYfbYsJtefzg0W9VYcVl2N9rYRlhsLS cvK0bIgom++KLVOz4kpo2PcSsJ75HcS8VeYajTwnE/4u4asLCTSPmITDvNqRa/Z29eCS 1MMPvq7RajdaZY5/p4CSeYhf9WbvsrICzf1XjVsHqaDdyLOvMo3XIEhGZqZjJcI8SdyZ CEKi+9xaS7iCOWRuRErzlCUVyEt0fVkDCAHqYvloaJbJnWu3ChUOngiNn/OweD0S6QwL d8SVzF6LJdRJ8rQi7tbI1HkJKT998odrPal75bbUzbc2VCG6/pEHi7UZ3JP2AiE9tpip IdNg== X-Forwarded-Encrypted: i=1; AKwUvBylpvJKL4bmNa2y8Lcn9nS//yAzJt7kyQplpe1b8ZhBzjOwk6CAi9FyoEfo7JRG+7k5S5C4/oJv6cvZ34KV@postgresql.org X-Gm-Message-State: AFuF++lTmPwGsGVrVKzHUkZqok6xkgtGhqGKTEpKXlrbafTCNPCSM916 lIG+TEpsZtbhobBQSEHx4f5UGM/5l/oFg2EhDLNKP8S+kJcKzq/pYL7DwYMpG3tFrzI= X-Gm-Gg: AYBFou3cHSV1AgCMaPwq9AqYJdKvmKuRJhsBKvaOeE9+tzUVQQYfZdzdvrYH4ICqJf/ WjOgpZq1SipEvDp9Ps79p0OYNw9g8Td3opORTUyhfHnCuONxnKfw2fWLlKsDkYUgEBMLLLN18Fi hdf4+1XNegTXgK/ZM9pzEKvjpk9iq6EP47o//K6UeLXK8QKQBbQ3hMM+qhfC17NXjUdshZ2mabW 7Hc5mEDFc3gx0xPWy8lxmrExZ/QiFb02+vRh038awYTKFcNyjucDsObtDdOA9DuOKTGKnJTFNbV CvA39L9mFJEvohpEuu54790Heihfv2YhKCgoalHDFqKNZS6x3sREr+gGA+5O2NCRo0lNLArTAqX 4Itq6pvouqcauiKRGhaZ3t8r2qyKGtHbqGjf0V49AM8otjZ0oH0EgyER+2usCmF38VwYlOJCDLW l1K2kRNleIwA7hn7YCPCBQt0jlCvHPhTDYYL4IDkRpQJIdu5tjc0fYQCUu843n1LaMqFHNA7z+y wMJxc6fR17h X-Received: by 2002:a05:600c:3b11:b0:49c:f617:7cf with SMTP id 5b1f17b1804b1-49e61645c2fmr5649495e9.0.1789063797022; Thu, 10 Sep 2026 11:09:57 -0700 (PDT) Received: from localhost (109-81-170-190.rct.o2.cz. [109.81.170.190]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49db038401fsm66126995e9.13.2026.09.10.11.09.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2026 11:09:56 -0700 (PDT) From: Antonin Houska To: Alvaro Herrera cc: Chao Li , 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: Comments: In-reply-to Alvaro Herrera message dated "Thu, 10 Sep 2026 12:22:52 +0200." X-Mailer: MH-E 8.6+git; nmh 1.8; GNU Emacs 28.3 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <45512.1789063796.1@localhost> Content-Transfer-Encoding: quoted-printable Date: Thu, 10 Sep 2026 20:09:56 +0200 Message-ID: <45513.1789063796@localhost> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Alvaro Herrera wrote: > On 2026-Sep-01, Alvaro Herrera wrote: > = > > On 2026-Sep-01, Antonin Houska wrote: > > = > > > I agree that the core issue is that we allow dropping an index that = is being > > > used as replica identity. > > > > > > Regarding catalog entries already broken this way, it appears that p= g_upgrade > > > fixes them because pg_dump does not issue "ALTER TABLE ... REPLICA I= DENTITY > > > USING INDEX ..." if there is not identity index. Thus after pg_resto= re, > > > pg_class(relreplident) becomes REPLICA_IDENTITY_DEFAULT. > > = > > I agree that disallowing the drop is a sensible thing to do. > = > 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 thi= nk 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. -- = Antonin Houska Web: https://www.cybertec-postgresql.com