Re: PostgreSQL 16 bug feedback

From: yexiu-glory <yexiu-glory(at)qq(dot)com>
To: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: PostgreSQL 16 bug feedback
Date: 2025-07-18 01:58:51
Message-ID: tencent_C96116A882BE19DFA694E4D98E7C331FA809@qq.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, 2025-07-18 at 00:21, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at&gt; wrote:
&gt; On Thu, 2025-07-17 at 19:41 +0800, yexiu-glory wrote:
&gt; &gt; I encountered a problem in PostgreSQL 16:
&gt; &gt; In db1, there is a user table with fields id, name, phone, and createtime
&gt; &gt; db2 replicates the user table from db1 through logical replication, specifying the fields as id, name, and createtime
&gt; &gt; Then, in db1, perform the following operation: alter table user replica identity full;
&gt; &gt; Then, modifying or deleting a record in the user table will result in an error,
&gt; &gt; The error message for modification is as follows, and similar errors also occur when deleting.
&gt; &gt; update "public"."user" set name='aaa’where id = 20005
&gt; &gt; &gt; ERROR: cannot update table "user"DETAIL: Column list used by the publication does not cover the replica identity.
&gt;
&gt; That's not a bug.
&gt; To make that replication work, you must have excluded the column "phone" from
&gt; the list of published columns. &nbsp;So it cannot be a part of the replica identity,
&gt; the set of columns used in the WHERE condition on the subscriber.
&gt;
&gt; Stick with REPLICA IDENTITY DEFAULT.
&gt;

I think it would be better if, when using the command "alter table user replica identity full" and specifying columns, the full-state synchronization should also synchronize all the specified fields?

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message David G. Johnston 2025-07-18 02:10:45 Re: PostgreSQL 16 bug feedback
Previous Message yexiu-glory 2025-07-18 01:52:24 Re: PostgreSQL 16 bug feedback