Search Postgresql Archives

Re: Are Foreign Key Disabled During Logical Replication Initial Sync?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 07.12.21 08:51, Avi Weinberg wrote:
Just to clarify, they are disabled during initial sync only or are always disabled on subscriber side?
Are all triggers disabled during initial sync or just foreign keys?

All triggers are by default disabled on replicas. See the ALTER TABLE clauses DISABLE/ENABLE [ REPLICA | ALWAYS ] TRIGGER to change this.

How can I know that initial sync completed for all tables?  Is it checking when pg_subscription_rel.srsubstate is 'i' or 'd' for all tables or there is a better way?

There are various ways to phrase this. The test suite often uses this query:

SELECT count(1) = 0 FROM pg_subscription_rel WHERE srsubstate NOT IN ('r', 's');





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux