Paul Rogers <progers(at)sparkbase(dot)com> writes:
> Why does the attached script fail with a foreign key constraint violation?
The ON DELETE RESTRICT is why. Per the fine manual:
[RESTRICT] is the same as NO ACTION except that the check is not
deferrable.
It's a bit odd, but that's the best interpretation we can make of the
spec's wording about how this should work.
regards, tom lane