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 1vUzGN-00B5Yx-0Q for pgsql-hackers@arkaria.postgresql.org; Mon, 15 Dec 2025 03:28:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vUzGL-00FDnR-0K for pgsql-hackers@arkaria.postgresql.org; Mon, 15 Dec 2025 03:28:41 +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 1vUzGK-00FDnH-2a for pgsql-hackers@lists.postgresql.org; Mon, 15 Dec 2025 03:28:41 +0000 Received: from mail-lf1-x131.google.com ([2a00:1450:4864:20::131]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vUzGJ-000iQm-36 for pgsql-hackers@lists.postgresql.org; Mon, 15 Dec 2025 03:28:40 +0000 Received: by mail-lf1-x131.google.com with SMTP id 2adb3069b0e04-59583505988so4186283e87.1 for ; Sun, 14 Dec 2025 19:28:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1765769317; x=1766374117; 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=DDYPIN3b9slHJicgQWAaUC+K+9wRDjr3Z4iwjRIKVT8=; b=iN1Spo28PceyhyZu71Nxjufz0NZp1DC3ZM6Q8O4AVf431hXm6hVRAjY/DF2v4+P/+2 /GZLglNHD3ihdXzp4TZkwc3fDcFGV8vD6/At++lYDo5fz2PCQCWF0+2/2ddV5ulsaR83 xxb+ybXHvjv4s4GubQNTwZLRT2XozbUjoMz5KrRIwzHUglazDZHkJrjW08sj910fu6AO diMoSLI4WukayKJ6x+XidfhcJpNyDOLwsPeypljMSeC4awpDLQ1rHfHnlRY2aS9umqF/ 82yP5gnrpJab4MPhOrYOa8ukfwYh22zIhV2F9eTxGexAMDT0jq3UKJNbvb9aVXLSrroL HjeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765769317; x=1766374117; 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=DDYPIN3b9slHJicgQWAaUC+K+9wRDjr3Z4iwjRIKVT8=; b=qNXshX0sOsGPhNd09clHu1DmgWZ3P/7qHuNHfT56GBDzDXm4aVT9kUMUkuto9oO8MO h5cpU1fZEoKvyhks2e+NggSfxTvXU8q5NLviJPn30GUm97vcuz2PdXvXSVrh8pfu3fWy 6GFuwH0kEZWHZTGsP6Rr+4956dGnSF4uchwYiju7cDjESPGro8KEcXigDo+TZL36uX3C XpbJe+IZ55R4xpu40VK8HkEZfy2s3hjrWQskKRNwEb7K5S1LFiYIX66vXOCQSEUvVUmJ vaw7CEUcWzp+YeOV5LuEvFUiTrv7+V2EI4qmt27tUBb/OtCwh5yV8o/YBnQGPc3aVTjH xSyQ== X-Forwarded-Encrypted: i=1; AJvYcCUWxwCSyqos3SQdHGKcY/teoKceOVaJcKgNcC2uftaQnVjudi3HoT7CllOdOPZAclX7LlfaSEu7fCnKkGem@lists.postgresql.org X-Gm-Message-State: AOJu0YxyKDMJJ1v9xuw30V8QY4cFmQL/Yp9mjjWZvwSsEeFo6OF5ikAN IShYE43/j33QsgEtlIxH9LQtRDqYvqSm9kSz++pW6Bz1QjWANULP0IzXRw5SlLCx1XpuKO1qUox q9nklvmNGwJEtbYVYK7a2CCPrp7/HApE= X-Gm-Gg: AY/fxX5INqhb+m69N59HgyE2+bYrdz8sOlE4n1IZGjWKcgE/qOoQgOCUgDLeAOuAqvR 1WrS/m0C5Jv/MARyyju7Lls0R9fINpRcNl/EfrcLdo+iWvTJ4cRY3hyua3ULoPZnwYsKHzzT8Q2 WCz0NzAQJaRuIRNHpjy5AbL59ZphnmGGe05mWNvRf/BmCzv/siLhEkkXqN7a+wCZGIpxxwDKOjS D95dX+mPNy5kXbhl0X/0mfk7cy99O2da+/r0mD1/0EP3dCGPc4PU0s30bvv+v/LqCHaTavynaQS lUXB0uspOu/IV2i1ck77Fm0HIA== X-Google-Smtp-Source: AGHT+IFKIHUxZ7K5LamBQdBjxEWXHDohiaIzG9Lr4/FQnLT2pNt4SK92f1O2iBr5dVlYHV/kVOx3ClSV6Qnp6eMHtbA= X-Received: by 2002:a05:6512:3b0a:b0:594:37bc:f40c with SMTP id 2adb3069b0e04-598fa6292a6mr3026685e87.10.1765769316671; Sun, 14 Dec 2025 19:28:36 -0800 (PST) MIME-Version: 1.0 References: <5ABD7727-CD22-4112-A186-0E788EE78109@gmail.com> In-Reply-To: <5ABD7727-CD22-4112-A186-0E788EE78109@gmail.com> From: Dilip Kumar Date: Mon, 15 Dec 2025 08:58:20 +0530 X-Gm-Features: AQt7F2pnLq9oUdDjZDL-XrEJo_3xxjEAuGtPyY7h-ne9xSgLr1cLo_k9igHF6IA Message-ID: Subject: Re: Improve logical replication usability when tables lack primary keys To: Chao Li Cc: Amit Kapila , Postgres hackers 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 Tue, Nov 11, 2025 at 6:11=E2=80=AFPM Chao Li wr= ote: > > Hi Amit, > > Thanks for asking. > > > On Nov 11, 2025, at 19:18, Amit Kapila wrote: > > > > On Mon, Nov 10, 2025 at 1:36=E2=80=AFPM Chao Li wrote: > >> > >> * BACKGROUND > >> > >> This requirement comes from several users operating large deployments,= particularly in HIS (Hospital Information Systems). The situation can be s= ummarized as follows: > >> > >> - A central DB operations team maintains the main database and configu= res logical replication for all tables. > >> - Multiple third-party application vendors are allowed to create new t= ables in that database. > >> - Some of these newly created tables lack a primary key. Since logical= replication with `REPLICATION IDENTITY DEFAULT` requires a primary key, su= ch tables silently fail to replicate. > >> - The DB operations team must then spend significant effort identifyin= g the affected tables and correcting them manually. > >> > > > > Can you share an example of how we silently fail to replicate? Won't > > in such cases UPDATE/DELETE will anyway raise an ERROR? > > > > Yes, UPDATE/DELETE will fail. That=E2=80=99s the easy case to expose the = error. Actually my patch will allow the update/delete. > > However, some tables, like dictionary tables, they are important, but don= =E2=80=99t have much update/delete, they may silently fail to replicate. But other than UPDATE/DELETE for what operation we need RI, I mean INSERT would work without any RI and UPDATE/DELETE will fail on the publisher itself without setting RI, so can you explain the exact case where it will silently fail to replicate? --=20 Regards, Dilip Kumar Google