Re: PostgreSQL 16 bug feedback - Mailing list pgsql-hackers

From Laurenz Albe
Subject Re: PostgreSQL 16 bug feedback
Date
Msg-id 7cd0e2452c84f7a1b0b728a8db86bdc8a09f9dd5.camel@cybertec.at
Whole thread Raw
In response to PostgreSQL 16 bug feedback  ("yexiu-glory" <yexiu-glory@qq.com>)
List pgsql-hackers
On Thu, 2025-07-17 at 19:41 +0800, yexiu-glory wrote:
> I encountered a problem in PostgreSQL 16:
> In db1, there is a user table with fields id, name, phone, and createtime
> db2 replicates the user table from db1 through logical replication, specifying the fields as id, name, and createtime
> Then, in db1, perform the following operation: alter table user replica identity full;
> Then, modifying or deleting a record in the user table will result in an error,
> The error message for modification is as follows, and similar errors also occur when deleting.
> update "public"."user" set name='aaa’where id = 20005
> > ERROR: cannot update table "user"DETAIL: Column list used by the publication does not cover the replica identity.

That's not a bug.
To make that replication work, you must have excluded the column "phone" from
the list of published columns.  So it cannot be a part of the replica identity,
the set of columns used in the WHERE condition on the subscriber.

Stick with REPLICA IDENTITY DEFAULT.

Yours,
Laurenz Albe



pgsql-hackers by date:

Previous
From: Álvaro Herrera
Date:
Subject: Re: Log prefix missing for subscriber log messages received from publisher
Next
From: Maciek Sakrejda
Date:
Subject: Re: simple patch for discussion