Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FK constraint violated in self table references #6131

Closed
monetdb-team opened this issue Nov 30, 2020 · 0 comments
Closed

FK constraint violated in self table references #6131

monetdb-team opened this issue Nov 30, 2020 · 0 comments
Labels
bug Something isn't working normal SQL wontfix This will not be worked on

Comments

@monetdb-team
Copy link

Date: 2016-11-28 15:34:23 +0100
From: Dean De Leo <>
To: SQL devs <>
Version: -- development

Last updated: 2020-09-21 20:32:54 +0200

Comment 24724

Date: 2016-11-28 15:34:23 +0100
From: Dean De Leo <>

User-Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.100 Safari/537.36
Build Identifier:

Performing an INSERT seems to violate the foreign key constraints that refer the same table, where the referred key is also the same inserted key. This is inconsistent with the behaviour of disabling the foreign key, inserting the data, and eventually re-enabling the foreign key constraint. In this latter case the INSERT statements succeed.

AFAIK any foreign key constraint should be checked after the update has taken place, so that the former statement should be allowed.

Reproducible: Always

Steps to Reproduce:

  1. See attached repro

Actual Results:

The INSERT statement is rejected due to the foreign key being violated

Expected Results:

The INSERT statement should be allowed

Comment 24725

Date: 2016-11-28 15:35:09 +0100
From: Dean De Leo <>

Created attachment 516
repro.sql

Attached file: repro2.sql (application/sql, 388 bytes)
Description: repro.sql

Comment 25146

Date: 2017-03-09 17:18:20 +0100
From: MonetDB Mercurial Repository <>

Changeset 73b379ba7970 made by Martin van Dinther martin.van.dinther@monetdbsolutions.com in the MonetDB repo, refers to this bug.

For complete details, see http//devmonetdborg/hg/MonetDB?cmd=changeset;node=73b379ba7970

Changeset description:

Add test for bug #6131

Comment 28101

Date: 2020-09-21 20:32:54 +0200
From: @njnes

*** Bug #6132 has been marked as a duplicate of this bug. ***

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working normal SQL wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants