2ndQuadrant / pglogical

Logical Replication extension for PostgreSQL 17, 16, 15, 14, 13, 12, 11, 10, 9.6, 9.5, 9.4 (Postgres), providing much faster replication than Slony, Bucardo or Londiste, as well as cross-version upgrades.
http://2ndquadrant.com/en/resources/pglogical/
Other
1.01k stars 153 forks source link

Existing tables don't have a queue_truncate_trigger trigger #27

Closed martinmarques closed 7 years ago

martinmarques commented 8 years ago

When creating a new table, pglogical will add an internal trigger for truncate operations queue_truncate_trigger_NNNNN, so if a truncate is executed over the table it will queue the command for the subscribers to consume.

The problem is that pglogical.truncate_trigger_add() isn't invoked on tables that were already present in the database before the node was subscribed, and so they don't have a truncate internal trigger.

IMO, we should add the queue_truncate_trigger to tables added to a replication set instead of doing so for all tables created.

Thoughts?

PJMODOS commented 8 years ago

Adding trigger when the table is added to repset sounds like good idea.