-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
sql: self-referencing constraint fails #40399
Comments
cc @dt @jordanlewis for triage |
any insight on this? |
Hi @donbowman, yes, it's the same as the issue you linked. We were attempting to get a fix for this available in upcoming release major (19.2) but ran into trouble near the end. It won't be available until 20.1. I think in the meantime, there's no way that you can have a row that refers to itself via an FK relationship. I'm going to close this as a duplicate but feel free to keep responding here - I'll follow up with any further questions you have. |
OK thank you. |
Solution is described (and will be implemented by fixing) #33475. |
Describe the problem
The following sql passes on postgresql, fails on cockroachdb (with foreign key violation). I believe it should pass since the table + constraint are satisfied at the end of the insert.
To Reproduce
This happens on an empty cockroachdb, just run the above sql.
Expected behavior
I expected to get 1 row inserted. In postgresql, I get:
Additional data / screenshots
Environment:
CockroachDB OSS v19.1.4 (x86_64-unknown-linux-gnu, built 2019/08/06 15:34:13, go1.11.6)
ubuntu 18.04
single node cluster
client app is cockroach sql
The text was updated successfully, but these errors were encountered: