Skip to content

Instantly share code, notes, and snippets.

@nirbhayc
Last active January 27, 2021 15:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nirbhayc/dc958d2b71163f3af35002b5d36c4f2d to your computer and use it in GitHub Desktop.
Save nirbhayc/dc958d2b71163f3af35002b5d36c4f2d to your computer and use it in GitHub Desktop.
create table t1 {
schema
{
int i
}
keys
{
"idx1" = i
}
} $$
create table t2 {
schema
{
int i
}
keys
{
"idx2" = i
}
constraints
{
"fk" = "idx2" -> <"t1":"idx1"> on delete restrict
}
}$$
insert into t1 values(1);
insert into t2 values(1);
delete from t1;
[delete from t1] failed with rc 3 verify key constraint cannot resolve constraint table 't1' index '0' key 'IDX1' -> table 't2' index '0'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment