Are Foreign Key Disabled During Logical Replication Initial Sync? - Mailing list pgsql-general

From Avi Weinberg
Subject Are Foreign Key Disabled During Logical Replication Initial Sync?
Date
Msg-id DB9PR07MB718088224479C92120503723CB6D9@DB9PR07MB7180.eurprd07.prod.outlook.com
Whole thread Raw
Responses Re: Are Foreign Key Disabled During Logical Replication Initial Sync?  (Peter Eisentraut <peter.eisentraut@enterprisedb.com>)
List pgsql-general

Hi all,

 

I understood that during logical replication initial sync tables are copied in full using some type of "copy command".  

Does it mean that populating each table is done in a single transaction?  If so, when I have tables with foreign keys between them, is it guaranteed that logical replication will populates the tables in the proper order so the foreign key will be enforced?  Or maybe the foreign keys are disabled during initial sync and only after all tables are populated the FKs are enabled again.

 

Thanks!

IMPORTANT - This email and any attachments is intended for the above named addressee(s), and may contain information which is confidential or privileged. If you are not the intended recipient, please inform the sender immediately and delete this email: you should not copy or use this e-mail for any purpose nor disclose its contents to any person.

pgsql-general by date:

Previous
From: Daniel Frey
Date:
Subject: Re: libpq: Which functions may hang due to network issues?
Next
From: Alan Hodgson
Date:
Subject: Query planner issue with preferring primary key over a better index when using ORDER BY and LIMIT