Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1muSsb-0008Lc-JK for pgsql-general@arkaria.postgresql.org; Tue, 07 Dec 2021 05:19:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1muSsa-0003YV-DN for pgsql-general@arkaria.postgresql.org; Tue, 07 Dec 2021 05:19:04 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1muSsZ-0003YK-C9 for pgsql-general@lists.postgresql.org; Tue, 07 Dec 2021 05:19:04 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1muSsW-0006CO-4D for pgsql-general@lists.postgresql.org; Tue, 07 Dec 2021 05:19:02 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 699055C00A6; Tue, 7 Dec 2021 00:18:58 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Tue, 07 Dec 2021 00:18:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=sso1HcnUsFtS40jSwVPkTiL+gAUWtCvKrT6o/PPJX Ug=; b=hC9i+erlo5mYWbhv1EbiAzDoi2A1gdZrxRvSK2HMLRBF+tyfZLvK2Z0Xr uGqqO+/7w+0/cH1TllYJge7vT8qf0dwgjGeslRSnBjqohwpnbZa4JN1xt05v7vak jzuWptDM6Zy2q+7hBBuiNzhDBjTtDpGLR0/fAym7uEBDelEyWH++J0TllVuYAo6w CGURATmE5ufih9trAQ5Am3s26yBOQkWE8lDtMhuIcb+HfClZU1wKJJb/8jAlcFNd 5+cDPGCTBfjkNsn4CCZd6unh2YiMw5gDP/SGaaLlY4+LG8nTETEKPkctqBuBBXDh 6dx5ySFMgec/DIVXUZS+1I3HgtwGA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrjeeggdekvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefkffggfgfuvfhfhfgjtgfgsehtkeertddtfeejnecuhfhrohhmpefrvghtvghr ucfgihhsvghnthhrrghuthcuoehpvghtvghrrdgvihhsvghnthhrrghuthesvghnthgvrh hprhhishgvuggsrdgtohhmqeenucggtffrrghtthgvrhhnpeelgfetfeeitdelleeggeej vefhueetfedvtdejheevueeifeegvdfhueeludetueenucevlhhushhtvghrufhiiigvpe dtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehpvghtvghrrdgvihhsvghnthhrrghuthes vghnthgvrhhprhhishgvuggsrdgtohhm X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 7 Dec 2021 00:18:57 -0500 (EST) Message-ID: <6a957e68-9490-2cf3-e390-88cd7545251c@enterprisedb.com> Date: Tue, 7 Dec 2021 06:18:56 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.3.2 Subject: Re: Are Foreign Key Disabled During Logical Replication Initial Sync? Content-Language: en-US To: Avi Weinberg , "pgsql-general@lists.postgresql.org" References: From: Peter Eisentraut In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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.