Re: [BUGS] BUG #14560: FK not valid are ignored during transactions - Mailing list pgsql-bugs

From David G. Johnston
Subject Re: [BUGS] BUG #14560: FK not valid are ignored during transactions
Date
Msg-id CAKFQuwZW1x4MPOCHxwNVJbniqUbm8LfmWvmwg5Ap_0N1We9cTA@mail.gmail.com
Whole thread Raw
In response to [BUGS] BUG #14560: FK not valid are ignored during transactions  (amos_operation@swiss-as.com)
List pgsql-bugs
On Tue, Feb 21, 2017 at 5:35 AM, <amos_operation@swiss-as.com> wrote:
The following bug has been logged on the website:

Bug reference:      14560
Logged by:          AMOS Operation
Email address:      amos_operation@swiss-as.com
PostgreSQL version: 9.5.5
Operating system:   Linux
Description:

alter table source add constraint fk_test foreign key (fk) references
target(id) not valid;

​Working as documented.

"""
[...] NOT VALID, ​which is currently only allowed for foreign key and CHECK constraints. If the constraint is marked NOT VALID, the potentially-lengthy initial check to verify that all rows in the table satisfy the constraint is skipped. The constraint will still be enforced against subsequent inserts or updates (that is, they'll fail unless there is a matching row in the referenced table, in the case of foreign keys; and they'll fail unless the new row matches the specified check constraints)
"""


David J.


pgsql-bugs by date:

Previous
From: mjsbeaton@gmail.com
Date:
Subject: [BUGS] BUG #14561: Unexpected disk buffer in FETCH handling
Next
From: Tom Lane
Date:
Subject: Re: [BUGS] BUG #14560: FK not valid are ignored during transactions