Hi ,
            On Fri, 2025-07-18 at 19:08 +0800, yexiu-glory wrote:
> I'm facing a problem here: our business requires logical data replication to 
> other
> departments, but at the same time, sensitive fields need to be filtered out.
> Therefore, we used the column filtering function when creating logical 
> replication.
> If we use `alter table table1 replica identity default;`, there is no issue 
> at all.
> However, when encountering new business scenarios, we need to use the CSI 
> columnar
> index function. Under the default setting, the synchronization delay of the 
> CSI
> columnar index is severe. Therefore, we need to use `alter table table1 
> replica
> identity full;` so that the CSI columnar index can perform data comparison 
> and only
> convert changed data when receiving data, thereby speeding up the data 
> conversion
> efficiency of the CSI columnar index. However, after using `alter table table1
> replica identity full;`, updating the table will result in an error.
> ERROR: cannot update table "table1"
> DETAIL: The column list used by the publication does not cover the replica 
> identity.
> So, is there any solution to this problem, or is there a better approach to
> accelerate the conversion efficiency of the CSI columnar index.

>I cannot help with that CSI thing.

>The only workaround I can think of is to create an index on the >publisher that
>contains all the columns you need in the replica identity and then ?>using
>that with ALTER TABLE ... REPLICA IDENTITY USING INDEX ...

>Yours,
>Laurenz Albe

         For the logical treplication issues we can try this out :

  1.
Create a unique index on a non-sensitive and  non-null column field
Or create Surrogate Primary Key
  2.
Use that index as the REPLICA IDENTITY.

        

Regards

Dinesh Nair


________________________________
From: yexiu-glory <yexiu-gl...@qq.com>
Sent: Friday, July 18, 2025 4:38 PM
To: pgsql-general <pgsql-general@lists.postgresql.org>
Subject: Regarding logical replication issues with PostgreSQL versions 16 and 
above

You don't often get email from yexiu-gl...@qq.com. Learn why this is 
important<https://aka.ms/LearnAboutSenderIdentification>
Caution: This email was sent from an external source. Please verify the 
sender’s identity before clicking links or opening attachments.
I'm facing a problem here: our business requires logical data replication to 
other departments, but at the same time, sensitive fields need to be filtered 
out. Therefore, we used the column filtering function when creating logical 
replication. If we use `alter table table1 replica identity default;`, there is 
no issue at all. However, when encountering new business scenarios, we need to 
use the CSI columnar index function. Under the default setting, the 
synchronization delay of the CSI columnar index is severe. Therefore, we need 
to use `alter table table1 replica identity full;` so that the CSI columnar 
index can perform data comparison and only convert changed data when receiving 
data, thereby speeding up the data conversion efficiency of the CSI columnar 
index. However, after using `alter table table1 replica identity full;`, 
updating the table will result in an error. ERROR: cannot update table "table1" 
DETAIL: The column list used by the publication does not cover the replica 
identity. So, is there any solution to this problem, or is there a better 
approach to accelerate the conversion efficiency of the CSI columnar index.

Reply via email to