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 1iS2yd-000090-JO for pgsql-bugs@arkaria.postgresql.org; Tue, 05 Nov 2019 17:50:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iS2yb-0007xX-LU for pgsql-bugs@arkaria.postgresql.org; Tue, 05 Nov 2019 17:50:45 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iS2yb-0007xQ-6G for pgsql-bugs@lists.postgresql.org; Tue, 05 Nov 2019 17:50:45 +0000 Received: from cyclops.postgrespro.ru ([93.174.131.138] helo=mail.postgrespro.ru) by makus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1iS2yX-0004oV-BY for pgsql-bugs@lists.postgresql.org; Tue, 05 Nov 2019 17:50:43 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.postgrespro.ru (Postfix) with ESMTP id 0159421C2867; Tue, 5 Nov 2019 20:50:38 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at postgrespro.ru X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=x tagged_above=-99 required=4 WHITELISTED tests=[] autolearn=unavailable Received: from [192.168.0.108] (pool-77-222-104-35.is74.ru [77.222.104.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mail.postgrespro.ru (Postfix) with ESMTPSA id 82B3321C2854; Tue, 5 Nov 2019 20:50:38 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1572976238; bh=hAqz+RtjPII6s3l+f/xNLnjTNvhr5uGbZCZ0xOhlZiI=; h=Subject:To:Cc:References:From:Date:In-Reply-To; b=fh1QSw5lffhR5h0G0+dQRVZ6OYLawq2Z92v6lheKUoReDMA3wFvXxr8y7ICD0v5oy 6jPB9UdrywSxumKo9fRaTA9IOjqrfiRnk8sU6TlY0KV7m5oectm3nCf/RNyOGMP2YP lQCdONO0HR/V6FLD4Rsn+Yto7QbIu3T886lVxhH8= Subject: Re: Logical replication can be broken by domain constraint with NOT VALID option To: Euler Taveira Cc: Tom Lane , PostgreSQL mailing lists References: <4bdc6250-03c6-0090-df77-580f998c4547@postgrespro.ru> <29155.1572795733@sss.pgh.pa.us> <48ef40e1-ea03-3eac-6f68-32d10e8cab08@postgrespro.ru> From: Andrey Lepikhov Organization: Postgres Professional Message-ID: <5e443723-b8d0-128c-bf21-1bc1e1db3c48@postgrespro.ru> Date: Tue, 5 Nov 2019 22:50:37 +0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 05/11/2019 20:21, Euler Taveira wrote: > Em dom., 3 de nov. de 2019 às 23:33, Andrey Lepikhov > escreveu: >> If this is the only reason, I propose a new version of the patch (see in >> attachment). It is satisfy the "Paranoid safety" rule. > I don't think that is acceptable either. If you have different schemas > (even for a small period of time), you should handle it dropping and > recreating the constraints. Changing schema is a big deal. But adding a constraint with "not valid" option can be used frequently. May be for change phone numbers format, for example. > Logical replication is far from a complete > feature. There should be cases that someone wants to enforce even the > FK constraints in the subscriber. I certainly wouldn't like to open > that can of worms. Relaxing constraints could lead to inconsistent > datasets across nodes. If you want to accept constraint violation, > drop the constraints. May be logical replication is incomplete. But it is no argument to not fix an errors that we found. In v2 version of the patch constraints are suppressed only for old version of the tuple that used for search in the heap and can't be applied. In this sense we do not relaxing any constraints. -- Andrey Lepikhov Postgres Professional https://postgrespro.com The Russian Postgres Company