pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
To: Avi Weinberg <AviW@gilat.com>
To: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: Are Foreign Key Disabled During Logical Replication Initial Sync?
Date: Tue, 7 Dec 2021 06:18:56 +0100
Message-ID: <6a957e68-9490-2cf3-e390-88cd7545251c@enterprisedb.com> (raw)
In-Reply-To: <DB9PR07MB718088224479C92120503723CB6D9@DB9PR07MB7180.eurprd07.prod.outlook.com>
References: <DB9PR07MB718088224479C92120503723CB6D9@DB9PR07MB7180.eurprd07.prod.outlook.com>

On 06.12.21 15:50, Avi Weinberg wrote:
> 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.

Foreign keys are disabled on logical replication subscribers.






view thread (4+ messages)  latest in thread

Message-ID: <6a957e68-9490-2cf3-e390-88cd7545251c@enterprisedb.com>
Permalink:  ../6a957e68-9490-2cf3-e390-88cd7545251c@enterprisedb.com/
Also on:    postgresql.org/message-id/6a957e68-9490-2cf3-e390-88cd7545251c@enterprisedb.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: peter.eisentraut@enterprisedb.com, AviW@gilat.com
  Subject: Re: Are Foreign Key Disabled During Logical Replication Initial Sync?
  In-Reply-To: <6a957e68-9490-2cf3-e390-88cd7545251c@enterprisedb.com>
  References: <DB9PR07MB718088224479C92120503723CB6D9@DB9PR07MB7180.eurprd07.prod.outlook.com> <6a957e68-9490-2cf3-e390-88cd7545251c@enterprisedb.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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