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 1wFoAK-005ZdE-35 for pgsql-hackers@arkaria.postgresql.org; Thu, 23 Apr 2026 07:08:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wFoAJ-000FdS-2L for pgsql-hackers@arkaria.postgresql.org; Thu, 23 Apr 2026 07:07:59 +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 1wFoAJ-000FdK-1N for pgsql-hackers@lists.postgresql.org; Thu, 23 Apr 2026 07:07:59 +0000 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wFoAE-00000002NTc-0PTA for pgsql-hackers@lists.postgresql.org; Thu, 23 Apr 2026 07:07:58 +0000 Received: by mail-pj1-x1032.google.com with SMTP id 98e67ed59e1d1-358d80f60ccso3672134a91.3 for ; Thu, 23 Apr 2026 00:07:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1776928074; cv=none; d=google.com; s=arc-20240605; b=R020kuGp3U4RVH8HIN8bQ7DxB48cIWCKrOCiq/XJZG65JsqJbhQ4UbJ94G4Qy5K3wK 3GXFod2kNr6DnqNmdVOhG6UT9whLOROmkRoSyItWiI38JGpsHmW3Oxyr98rS04+E6Pd8 kuPJ1PAsf+mokvbRka1Xz24UWuZN+NDMjxzGKS+LgnBw4ymtJvHBJoGnw7+f/GlBxHHS W0WrjGk/NVGSr40OsQcKFmRbTXeZu36SLkM7u5jX+g8RA7JU1GcB9NcVAWBUuVggbjZh /SFhJbDtETb9zgvQOnBakidV8enzx2s/AIK/AqVEEqLls09f+P0ZGSiUzkEHM9t1VO3p KmOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=BsX2LTVQEbne0aKv76c2WE9DwUXTMPXWBQmyaLxw7cg=; fh=jPuLBzgSRQyOYcyQOxDrS5wJRw/L7MPFf/QsD/sBxyU=; b=GHI6H7qoGz/vLhC2wDOmEUTHtmq8go67Zgwr5oToZUPSIywD8qkSHhvuoUjYNCPiw6 e0b/AKuFnIdDEPoKH27id5OwY6goCnwqbxwVszHvIWrqL8bsCX152OYVJpLlOdvJnhdO ORlxmq8Ibkx4+UiOo8JLaF84HM6c918VRPtWfCx4uJMuw0TBEp4o+dEWzUguFSOpkWpy v6WzThQ2sQS/06lUbHpfwbcsf9NMUTrb+u3ITV2xRcODjnwd7P5wvSzk4qRDLlEBo7KI ObNI5BWQx7V11nDWBUoDNsSZScWmIJEvXeRJS8iOHBXSZzoT4HSIqxu0u5r/3QfHYUzk iaHg==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1776928074; x=1777532874; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=BsX2LTVQEbne0aKv76c2WE9DwUXTMPXWBQmyaLxw7cg=; b=lwRhBLmHS1YXe1pGx2RMnrYkXhzAVxsb2t21THEfzA/QxXLrpB2HHlgJvtaK82PmDI vhhmL/20ReYOgAmBzMxyhcPAwpIPvbVXVqG4LsD6UUJazzLYwNye3MC/x04vR/pvzuwb gDCm+ZP43MaU9UxlV9cIplSCvRkMsarH14g5xiymp/A9RrD8tPBQp/GMf6Z6IN9/FUhy zM/X4/W70BpHsF0St9yfMuRXzpSwrxAl04qIKDNVyY8lQE4t32mJJ+0kyEZeFEQKP9Co P0bw5V0ADKeDKqrWiDq8SEl+M+TsjOM9gB9lYxOfBoU82qcB5HFGrxMlqQ0AHuX3pKUj NjTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776928074; x=1777532874; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=BsX2LTVQEbne0aKv76c2WE9DwUXTMPXWBQmyaLxw7cg=; b=MoeuMaarS4csdkMrBBbqdf+Grd/g3upadfRw7hHChgcPE+CPctuh2ltAThI1VB+sGA 0sHzPi1+wbX61c0TlCIQfiDXJ7wqMzpUfVxKLx3uWBmmpsXVWcO/yFFdUAzscKZZycvM zJ1aNuZzXSToQ5mCEOgsMSPDA5mM0i87GdR4YbR3bup0/sRKPUE2Ca3W/Mlz4TyX8Wbr dY/w0uyNGxMe7QU028C+dvt3xQL/fUIS2xNSY17TRa4AWGtPC+2PCRJiLh4JCtaewxYw CfjuXsTCJysIv69uAlB1bW872xD8Ui3MvGyQQIG1Eg9P+BG5fk/wP4u0t0AOhPGUeotA z0nA== X-Forwarded-Encrypted: i=1; AFNElJ/pC61bC3Q8sDryC4+zD4hnFNqC2Q83o6WYFmno8uErKMbeJr3lsBgBfdHpw85iC5E1+OAhJyhFe1hTHLoB@lists.postgresql.org X-Gm-Message-State: AOJu0YzMvKpvBFVn5hQPykfMq4Oq7QZpmzYubgHGFvsS4meDV6fY6pGz lPEMhAO8Uj8VPFR/BjOXyr0hzop1cNqUakrXqaUFRAjQ9O4BA9+jqf8VR2K6ZDn3ozluzDPeRjs OO7nT/eqNSXzHJ6h8M2ZTY9pmHwQlKsIlnKqPi1I= X-Gm-Gg: AeBDievuTId+iNlg4ctfuxuiIslIXqckekFSEi1q6rRSvS9hn9cgQ5JM1EDg6M8m/K7 Zhvrzf3EbVSNm+pigEIj2VfCqfuxO0+qEH9nTg9x1nPT7p7UMJh/w5H/OVpDVSHQEpkV4L4KH2i hmZRIOmfSPynJ+1aOXRubc4SLx244rm/fl2WgAYdCKGOe7pTsP8fFjqVpO20u3WoMHABmJq0VdE WEGVJeb0uaFLfg/mJ9tAmH3gq8mRIoaBTZnum35n5T75xztUbQpySWz6fH7qZtJbcosetCcvPq0 CtTz4tyh8AEr+ZxSUJYllmghQ5cM3v9+SGbMO06I+bZp76hWNFhL2r6aukClUfVb X-Received: by 2002:a17:90b:3dc8:b0:35f:b6a1:8d23 with SMTP id 98e67ed59e1d1-3614040b34bmr29452101a91.11.1776928073587; Thu, 23 Apr 2026 00:07:53 -0700 (PDT) MIME-Version: 1.0 References: <35B6A159-C2EF-4346-9394-7CB3E168B1A5@gmail.com> In-Reply-To: <35B6A159-C2EF-4346-9394-7CB3E168B1A5@gmail.com> From: shveta malik Date: Thu, 23 Apr 2026 12:37:41 +0530 X-Gm-Features: AQROBzAU1HXVzAU4t6dE6HCf-ZAsoAivmPuRm8aBP9eNo6LDzIqo7Kz_AR86EyU Message-ID: Subject: Re: Warn on missing replica identity in CREATE/ALTER PUBLICATION To: Chao Li Cc: =?UTF-8?B?5Y2X5ouT5byl?= , pgsql-hackers@lists.postgresql.org, shveta malik Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, Apr 23, 2026 at 12:21=E2=80=AFPM Chao Li w= rote: > > > > > On Apr 23, 2026, at 13:46, =E5=8D=97=E6=8B=93=E5=BC=A5 wrote: > > > > # Reply draft v2 to Shveta > > > > --- > > > > Hi Shveta, > > > > Thanks for pointing out that thread. I've read through it carefully. > > > > I believe the two proposals address different aspects of the same > > problem: > > > > - 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. > > > > A WARNING at publication creation time is useful regardless of whether > > a fallback mechanism exists, because: > > > > - 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 m= akes > > the misconfiguration visible earlier. > > > > 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. > > > > 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? > > > > 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. > > > > [1] https://www.postgresql.org/message-id/a9da608f-24be-4213-a712-85928= 52d37f1%40app.fastmail.com > > > > 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, b= ut I think it would be better to consider the two features together as a wh= ole solution from a system perspective. > > In any case, new features will have to wait for v20 until July, so we sti= ll have time for more discussion and deeper consideration. I agree. But if the RI fallback option gets delayed due to lack of consensus on the design or other reasons, issuing a WARNING during publication creation seems like a reasonable approach. thanks Shveta