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

From: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
To: Avi Weinberg <AviW(at)gilat(dot)com>, "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Are Foreign Key Disabled During Logical Replication Initial Sync?
Date: 2021-12-07 05:18:56
Message-ID: 6a957e68-9490-2cf3-e390-88cd7545251c@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Nick Cleaton 2021-12-07 07:07:37 Re: Advice on using materialized views
Previous Message Mladen Gogala 2021-12-07 04:06:46 Re: Query planner issue with preferring primary key over a better index when using ORDER BY and LIMIT