Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hVWOz-0002YE-26 for pgsql-admin@arkaria.postgresql.org; Tue, 28 May 2019 07:20:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hVWOv-0008GZ-Hr for pgsql-admin@arkaria.postgresql.org; Tue, 28 May 2019 07:20:01 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hVWOv-0008GG-7t for pgsql-admin@lists.postgresql.org; Tue, 28 May 2019 07:20:01 +0000 Received: from hermes.gatewaynet.com ([193.92.121.98]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hVWOo-0007Cm-6u for pgsql-admin@lists.postgresql.org; Tue, 28 May 2019 07:20:00 +0000 Received: from smadev.internal.net (pc131.internal.net [10.9.200.131]) by hermes.gatewaynet.com (8.15.2/8.15.2/Debian-8) with ESMTPS id x4S7JksS030110 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 28 May 2019 10:19:51 +0300 Received: from smadev.internal.net (smadev [10.9.200.131]) by smadev.internal.net (8.15.2/8.15.2) with ESMTP id x4S7Jkem024352 for ; Tue, 28 May 2019 10:19:46 +0300 (EEST) (envelope-from achill@matrix.gatewaynet.com) Subject: Re: Logical Replication postgres 10.5 To: pgsql-admin@lists.postgresql.org References: From: Achilleas Mantzios Message-ID: Date: Tue, 28 May 2019 10:19:46 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.3.2 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------01588F21D207989778958A9E" Content-Language: en-US X-Virus-Scanned: clamav-milter 0.100.3 at hermes X-Virus-Status: Clean X-Spam-Status: No, score=-26.9 required=5.0 tests=ALL_TRUSTED,DYN_HAM_COORD, DYN_HAM_IT,DYN_HAM_NAUTICAL,DYN_SPAM_WATCHES8,HTML_MESSAGE,TW_PG autolearn=unavailable autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on hermes.gatewaynet.com List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------01588F21D207989778958A9E Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit On 28/5/19 8:21 π.μ., Mai Peng wrote: > Hello, > Is Logical Replication ignore foreign key constraint ? How does it possible ? The apply process on the subscriber runs with |session_replication_role| set to |replica, this limits trigger firing, excluding normal triggers . FK constraints in pgsql are implemented with triggers, hence the behavior you are observing. | > Thank you > > -- Achilleas Mantzios IT DEV Lead IT DEPT Dynacom Tankers Mgmt --------------01588F21D207989778958A9E Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit
On 28/5/19 8:21 π.μ., Mai Peng wrote:
Hello,
Is Logical Replication ignore foreign key constraint ? How does it possible ?
The apply process on the subscriber runs with session_replication_role set to replica, this limits trigger firing, excluding normal triggers . FK constraints in pgsql are implemented with triggers, hence the behavior you are observing.
Thank you




-- 
Achilleas Mantzios
IT DEV Lead
IT DEPT
Dynacom Tankers Mgmt
--------------01588F21D207989778958A9E--