Re: Logical replication can be broken by domain constraint with NOTVALID option - Mailing list pgsql-bugs

From Andrey Lepikhov
Subject Re: Logical replication can be broken by domain constraint with NOTVALID option
Date
Msg-id 5e443723-b8d0-128c-bf21-1bc1e1db3c48@postgrespro.ru
Whole thread Raw
In response to Re: Logical replication can be broken by domain constraint with NOTVALID option  (Euler Taveira <euler@timbira.com.br>)
List pgsql-bugs

On 05/11/2019 20:21, Euler Taveira wrote:
> Em dom., 3 de nov. de 2019 às 23:33, Andrey Lepikhov
> <a.lepikhov@postgrespro.ru> 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



pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #16095: Segfault while executing trigger
Next
From: Andres Freund
Date:
Subject: Re: BUG #16095: Segfault while executing trigger