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 1wFntz-005ZKd-2n for pgsql-hackers@arkaria.postgresql.org; Thu, 23 Apr 2026 06:51:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wFnty-0003eP-36 for pgsql-hackers@arkaria.postgresql.org; Thu, 23 Apr 2026 06:51:06 +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 1wFnty-0003eH-2C for pgsql-hackers@lists.postgresql.org; Thu, 23 Apr 2026 06:51:06 +0000 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wFntw-00000002bXq-2FXI for pgsql-hackers@lists.postgresql.org; Thu, 23 Apr 2026 06:51:06 +0000 Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-83177129e28so94345b3a.1 for ; Wed, 22 Apr 2026 23:51:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1776927062; x=1777531862; darn=lists.postgresql.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=/+yQRKVZYepNHLVExhA3sV6zKkghk9Iw9g4oU1Dc5TA=; b=MoNJVnAndWofKqXU0eC3ildx4e3esGcLM47/aS3Hfmo3nQIAhvKPkJSbAF5rPJ44vk 9qQqcgQPaLetjQmRKyZ+gBiyhw+8GxPESyfAoot56oIYNdlNIvtVzNL33ACdmtxgUvLU 6u/Pw/Ey9JN528W2nfnELfPm2d5TrTjI8FkQSl2+ow0obmVBFhLERlgwd5EfmALTl03B M6UCblhRthK2ZG+U2mz7hwWhohLiIh6b2zzPl2aaeporCUF8n2/AW1XG+oPaoWNQSsRl +c6yayEqbc/ZccYl5z4uwcLEUrztqTmFdSdSRBzmk3HPOKFPjH4g3Hs+NXCl0kJ+8RPw bi7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776927062; x=1777531862; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-gg:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=/+yQRKVZYepNHLVExhA3sV6zKkghk9Iw9g4oU1Dc5TA=; b=h+B2SGGDhfIlui8E1I2ICyhr2tHd24GcGerZrmg2+O/jpXl4fnXrjFmOjcL4Vyu5DQ 6g8xXLriMz9XiQIT2DFDp63IVPvuP2GgRTEkusJ8rezhkRw9DPSBQdmRf+3HCiWe28X7 UGBgUj8t2pl2pX3/5KLkPEHxfXczF7wkHo/DS0suLqDgQoP/irjBPyKDGyHljgVdgVJ0 jMNjLaIWw2J4pIqLr4pM0gbfxj0Tcz5jGQTXrOgb28gJTkAfcktr5evg8f8OXlQpYooJ jFKf2JldkwXphcnm+G6+ETEZAFqQcjjBIG19gV7yzQDHMgJ4KZeA/hEy8ADWsJk+9crg IVKA== X-Forwarded-Encrypted: i=1; AFNElJ9LkUEBRmP//khdcaIqwqpVagZIU2eEipC1S9chJY8TNmWf/BMLDNmv1lmbuurtI938TLk4EDxANscYKa/F@lists.postgresql.org X-Gm-Message-State: AOJu0YyAZcKT5J9/D1w3feu9LZYrLaXi2iFvXIeCXjOm/coquHMQT1sl 9X64dV4PBC4sDf3+UTiniShjt91vBY1ypuqUIdgl3eSRlX6Qb4r5F8eX X-Gm-Gg: AeBDieu6O84UPfPQW91YJEvPcZ3DdnxGIPw0lICYPRaRdW6EYNva1v+P849Cz230q2M eiuipN1bQTOhiIqzvLYkHCY5CKdwUWmSba8Rz+hjxu87p0OLJ3KeL4dPw4TOXJDRBG4mG2YlaxP 7Ak7jKzlwo3Wd7ssfrYCVOjWsH7Ca4DdZohqoIVZUrBwzMjhnHrQDu+6u1/DEVwMvpOllZLY4ZQ E2OOlY4Cth8WLj77GO0RcM9VzTigAmdFtCg6voxaFfc2bGWZeQ6iDQhBEmvIuOKb1XyjFf35tbd uulSZ6BSgQlYxqdBeKZ5Zr44EdRKkvRFByAjFmyRE1X0wHHa877nZwX+HQoZhd6yLouIEgd8tIP mVqu5/C7El8a3zB41tMq7iV8rL6IxEG/bOZ5xm/l3sPMF4MtjCQzd9qUoVCubaT1105xJdY3OXm nVr+tM+gHR6ae3E0/hW+m8kwWURaFndPeEykKLXHjeZA== X-Received: by 2002:a05:6a00:340f:b0:82f:5125:a324 with SMTP id d2e1a72fcca58-82f8c8db55cmr26264116b3a.36.1776927062339; Wed, 22 Apr 2026 23:51:02 -0700 (PDT) Received: from smtpclient.apple ([45.32.121.103]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-82f8e9819e5sm20037171b3a.2.2026.04.22.23.51.00 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Apr 2026 23:51:01 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3864.400.21\)) Subject: Re: Warn on missing replica identity in CREATE/ALTER PUBLICATION From: Chao Li In-Reply-To: Date: Thu, 23 Apr 2026 14:50:22 +0800 Cc: shveta malik , pgsql-hackers@lists.postgresql.org Content-Transfer-Encoding: quoted-printable Message-Id: <35B6A159-C2EF-4346-9394-7CB3E168B1A5@gmail.com> References: To: =?utf-8?B?5Y2X5ouT5byl?= X-Mailer: Apple Mail (2.3864.400.21) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On Apr 23, 2026, at 13:46, =E5=8D=97=E6=8B=93=E5=BC=A5 = wrote: >=20 > # Reply draft v2 to Shveta >=20 > --- >=20 > Hi Shveta, >=20 > Thanks for pointing out that thread. I've read through it carefully. >=20 > I believe the two proposals address different aspects of the same > problem: >=20 > - The fallback RI approach changes runtime behavior so that tables > without a primary key can still replicate UPDATE/DELETE. > - This proposal simply warns at DDL time that a publication contains > tables whose replica identity will cause UPDATE/DELETE to fail at > replication time. >=20 > A WARNING at publication creation time is useful regardless of whether > a fallback mechanism exists, because: >=20 > - If a table has REPLICA IDENTITY DEFAULT with no primary key, it > silently falls back to NOTHING. Combining that with a publication > that publishes updates/deletes is guaranteed to fail at runtime. > A WARNING at DDL time closes this gap. > - Even users who explicitly set REPLICA IDENTITY NOTHING and add the > table to an update/delete publication would benefit from a reminder, > since that combination cannot succeed. > - The WARNING does not change any existing behavior =E2=80=94 it only = makes > the misconfiguration visible earlier. >=20 > Notably, Euler mentioned in that thread [1] that he would "suggest a > way to disallow or add a warning message while creating the > publication or adding new tables", which is exactly what this proposal > does. >=20 > That said, I see the two proposals as complementary. Should I continue > this as a separate thread, or would it be better to join the existing > discussion? >=20 > I have a working patch covering all publication paths (FOR TABLE, > FOR TABLES IN SCHEMA, FOR ALL TABLES, ALTER PUBLICATION). Happy to > post it either way. >=20 > [1] = https://www.postgresql.org/message-id/a9da608f-24be-4213-a712-8592852d37f1= %40app.fastmail.com >=20 You are very welcome to join the thread, as the initiator of that = thread. I am not personally against your idea of adding such a warning message, = but I think it would be better to consider the two features together as = a whole solution from a system perspective. In any case, new features will have to wait for v20 until July, so we = still have time for more discussion and deeper consideration. Best regards, -- Chao Li (Evan) HighGo Software Co., Ltd. https://www.highgo.com/