-
Notifications
You must be signed in to change notification settings - Fork 4.1k
sql: ON DELETE SET DEFAULT violates constraints #23361
Copy link
Copy link
Closed
Labels
C-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
Milestone
Description
Found while investigating #22304.
create table base (x int primary key);
create table derived(x int primary key, y int default 123 references base(x) on delete set default);
insert into base values(456);
insert into derived values (111, 456);
--- bang:
delete from base where true;Expected, pg has this correct:
pq: foreign key violation: value [123] not found in base@primary [x]
in CockroachDB, currently, incorrect: no error.
cc @BramGruneir.
I have a patch incoming.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
C-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.