Subject: Regarding: Replication of TRUNCATE commands is not working

From: Arvind Raghuwanshi <[email-masked]>
Date: Tue, 9 Apr 2024 14:50:10 +0530

Hi,
I have tried to run the TRUNCATE command  and found out that it's not
getting replicated using logical replication for pgsql.
I have also checked the schema change using pg_dump command but the schema
change also not getting detected for TRUNCATE command.

However on pgsql logical replication doc page[1] , it's mentioned
that Replication of TRUNCATE commands is supported.

[1] PostgreSQL: Documentation: 16: 31.6. Restrictions
<https://www.postgresql.org/docs/current/logical-replication-restrictions.html>

Any idea how we can solve this?

Thanks
Arvind

---

From: Laurenz Albe <[email-masked]>
Date: Tue, 09 Apr 2024 12:38:09 +0200

On Tue, 2024-04-09 at 14:50 +0530, Arvind Raghuwanshi wrote:
> I have tried to run the TRUNCATE command  and found out that it's not getting replicated using logical replication for pgsql.
> I have also checked the schema change using pg_dump command but the schema change also not getting detected for TRUNCATE command.
> 
> However on pgsql logical replication doc page[1] , it's mentioned that Replication of TRUNCATE commands is supported.
> 

What PostgreSQL version are you using?  The feature was introduced in v11.
How exactly is the publication defined?  Perhaps TRUNCATE is excluded.

Yours,
Laurenz Albe