public inbox for [email protected]  
help / color / mirror / Atom feed
Re: Regarding logical replication issues with PostgreSQL versions 16and above
2+ messages / 2 participants
[nested] [flat]

* Re: Regarding logical replication issues with PostgreSQL versions 16and above
@ 2025-07-29 07:00 =?utf-8?B?eWV4aXUtZ2xvcnk=?= <[email protected]>
  2025-07-29 15:35 ` Re: Regarding logical replication issues with PostgreSQL versions 16and above Laurenz Albe <[email protected]>
  0 siblings, 1 reply; 2+ messages in thread

From: =?utf-8?B?eWV4aXUtZ2xvcnk=?= @ 2025-07-29 07:00 UTC (permalink / raw)
  To: =?utf-8?B?RElORVNIIE5BSVI=?= <[email protected]>; =?utf-8?B?cGdzcWwtZ2VuZXJhbA==?= <[email protected]>

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


&gt; On Fri, 2025-07-28 at 14:06 +0800,dinesh_nair write:
&gt;  For the logical treplication issues we can try this out :
&gt; 1.Create a unique index on a non-sensitive and &nbsp;non-null column field
&gt; Or create Surrogate Primary Key
&gt; 2.Use that index as the REPLICA IDENTITY.




The approach of adding unique indexes is not suitable for our business.
Even if it is applicable to some individual tables, it is not suitable for all tables.
My idea is whether it is possible to synchronize only the data of all columns that are filtered
and retained based on the configuration of the filter columns during full synchronization.

^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Regarding logical replication issues with PostgreSQL versions 16and above
  2025-07-29 07:00 Re: Regarding logical replication issues with PostgreSQL versions 16and above =?utf-8?B?eWV4aXUtZ2xvcnk=?= <[email protected]>
@ 2025-07-29 15:35 ` Laurenz Albe <[email protected]>
  0 siblings, 0 replies; 2+ messages in thread

From: Laurenz Albe @ 2025-07-29 15:35 UTC (permalink / raw)
  To: yexiu-glory <[email protected]>; DINESH NAIR <[email protected]>; pgsql-general <[email protected]>

On Tue, 2025-07-29 at 15:00 +0800, yexiu-glory wrote:
> The approach of adding unique indexes is not suitable for our business.

Well, then I guess that logical replication is not suitable for your business.

Yours,
Laurenz Albe






^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2025-07-29 15:35 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-07-29 07:00 Re: Regarding logical replication issues with PostgreSQL versions 16and above =?utf-8?B?eWV4aXUtZ2xvcnk=?= <[email protected]>
2025-07-29 15:35 ` Laurenz Albe <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox