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 1vVKAB-000UYo-1W for pgsql-hackers@arkaria.postgresql.org; Tue, 16 Dec 2025 01:47:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vVKAA-003Z2p-1W for pgsql-hackers@arkaria.postgresql.org; Tue, 16 Dec 2025 01:47:43 +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 1vVKA9-003Z2f-24 for pgsql-hackers@lists.postgresql.org; Tue, 16 Dec 2025 01:47:42 +0000 Received: from fout-b6-smtp.messagingengine.com ([202.12.124.149]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vVKA7-000xqb-0i for pgsql-hackers@lists.postgresql.org; Tue, 16 Dec 2025 01:47:42 +0000 Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46]) by mailfout.stl.internal (Postfix) with ESMTP id 783841D000FA; Mon, 15 Dec 2025 20:47:36 -0500 (EST) Received: from phl-imap-05 ([10.202.2.95]) by phl-compute-06.internal (MEProxy); Mon, 15 Dec 2025 20:47:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eulerto.com; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1765849656; x=1765936056; bh=VtTmvRVJnsd5caqyj8cyeRSwmU8jqgCRCxgBuYaNTeI=; b= GymlvveaxHqWWva4yidgu575pBjTyJhpU/7kdzdJI1PunSRDpcju6iE/gZshLWmx Qz63uM0vHdfNsrdN+zAFQmaThEzZGVXtKnl8HHPTyBgJ3/goyVzs4QnPhVHtnCN3 DusOBfnh8NbIrBPUSQRUYraS1dfPJbidiFJ8mOsikx+ButqT/EgJsPmg9lcPGUc6 k2lymJx/Jw245PbnoaNumxJs5lPeODVoU6cvNiL09XFDMKRM7N40uka8Gi5Koxmo OJR5PEWbupUJp9h0iZQd4CxG2PeE12A5pHuuxGHN7Q1hS6HL3ypLvgLApU7LiJhi /u578sHSF9g5e4I5IrhWqg== 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 :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1765849656; x= 1765936056; bh=VtTmvRVJnsd5caqyj8cyeRSwmU8jqgCRCxgBuYaNTeI=; b=d ACGEsUAGYMCNGaMC0Eb7kXIW6mSUPlRjeBVH4NwdNs6sthpuLhCvqJ/Ks7QjPaBj Ppn+8Ma8TPj5f4R4Q20tWIKPaOIooo96MlQUOYvdWOc5Nii0fVA/jYT8ctzquMGu pOAFO0PcxoqJdArQyvhWaLrufbZs31wOfII/JD+cMd4XMtG4+s15TPoqg6hEOIGO wAfoKWcoQDKRfIeDPY9vuKFF/1eKTprg9uu0bXQwy9B3r/wdUCJ7DerouB1/hLMD DWr49e/NyJge+lW6Ur+y1aE4olCk8+donuAuAywwMFeNFuZyiTTD9bGXu+dFSXHc RgP/RhDIkE4EIPUpEuhEw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgdefkeegudcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpefoggffhffvvefkjghfufgtgfesthhqredtredtjeenucfhrhhomhepfdfguhhlvghr ucfvrghvvghirhgrfdcuoegvuhhlvghrsegvuhhlvghrthhordgtohhmqeenucggtffrrg htthgvrhhnpeefvdfhgfdtffdvjeejffffleeiueffhfdtfeekveektdegteelieeltedv udevheenucffohhmrghinhepphhoshhtghhrrdgvshdpvghnthgvrhhprhhishgvuggsrd gtohhmnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhep vghulhgvrhesvghulhgvrhhtohdrtghomhdpnhgspghrtghpthhtohepfedpmhhouggvpe hsmhhtphhouhhtpdhrtghpthhtoheprghmihhtrdhkrghpihhlrgduieesghhmrghilhdr tghomhdprhgtphhtthhopehlihdrvghvrghnrdgthhgrohesghhmrghilhdrtghomhdprh gtphhtthhopehpghhsqhhlqdhhrggtkhgvrhhssehlihhsthhsrdhpohhsthhgrhgvshhq lhdrohhrgh X-ME-Proxy: Feedback-ID: i0c21471d:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id 2BA4A1820054; Mon, 15 Dec 2025 20:47:36 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface MIME-Version: 1.0 X-ThreadId: ASirQp6p08EV Date: Mon, 15 Dec 2025 22:47:12 -0300 From: "Euler Taveira" To: "Chao Li" Cc: "Postgres hackers" , "Amit Kapila" Message-Id: <7cd087f7-c914-4c3c-9556-dafcfd38eefb@app.fastmail.com> In-Reply-To: <7BC72FB9-2235-414F-9D45-EA2C8A2FF09A@gmail.com> References: <7BC72FB9-2235-414F-9D45-EA2C8A2FF09A@gmail.com> Subject: Re: Improve logical replication usability when tables lack primary keys 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 Sun, Dec 14, 2025, at 10:57 PM, Chao Li wrote: > I=E2=80=99ve thought this over and discussed it with our field teams. = It looks=20 > to us that introducing a new GUC like default_replica_identity does no= t=20 > really address our pain point. > > Our core requirement is to allow tables without a primary key to use=20 > FULL as the replica identity, while tables with a primary key should=20 > continue to use DEFAULT. > As Amit said in [1], this proposal is not viable because of WAL volume. = Since you don't know if table foo without primary key will replicate, it defau= lts to log the old tuple even if you never add this table to a publication. > If we add default_replica_identity and set it to FULL, then a newly=20 > created table that does have a primary key would also end up using=20 > FULL, which is definitely not what we want. > You can propose a different behavior. Let's say FULL_NO_PK. > As you mentioned, PostgreSQL already has a fallback from DEFAULT to=20 > NOTHING. What we actually want is the ability to customize this=20 > fallback, so that users can choose whether DEFAULT falls back to=20 > NOTHING or to FULL. Customizing the fallback via a new GUC would also=20 > allow field teams to set this option per database. > > If we do want to add default_replica_identity, I think that should be=20 > treated as a separate topic. By the way, could you explain what use=20 > case you have in mind for it? > It is an alternative way for ALTER TABLE ... REPLICA IDENTITY to set a non-default value. It also has the advantage of applying to multiple tab= les if you are in the same session. If the majority of your tables has a non-de= fault replica identity, it would drastically reduce the number of ALTER TABLE = ... REPLICA IDENTITY lines in your dump. I think it is unlikely that we would change the replica identity default= value but we could consider additional ones. Hence, the default_replica_identi= ty plus a new value could improve your scenario. I don't have the complete pictu= re so I cannot propose a feasible solution. Maybe what I said is enough or maybe= not. Regarding the default_replica_identity proposal, it is just a value to u= se while creating a table. [1] postgr.es/m/CAA4eK1KzjxO-qWjWSox6e6AWH4FVU5ZPEgeZ+na=3Deyov7umutg@ma= il.gmail.com --=20 Euler Taveira EDB https://www.enterprisedb.com/