Postgres Foreign Key Constraint Language Collocations
Practise the standard verbs for adding Postgres foreign key constraints safely.
0 / 5 completed
1 / 5
Fill in: 'We ___ a foreign key constraint on the orders table so a customer_id can never reference a row that doesn't actually exist.'
We 'add a constraint' — the standard, simple collocation for attaching a referential integrity rule to a column. The other options are less idiomatic here.
2 / 5
Fill in: 'Skipping foreign key constraints for the sake of write speed can ___ orphaned rows accumulating once related records get deleted.'
We say skipped constraints will 'leave' orphaned rows behind — the standard, natural collocation for the resulting problem. The other options aren't idiomatic here.
3 / 5
Fill in: 'We ___ a cascade delete on the constraint so removing a parent row cleanly removes its dependent child rows too.'
We 'configure' cascade behaviour — the standard collocation for setting up what happens on a referenced row's deletion. The other options aren't idiomatic here.
4 / 5
Fill in: 'We ___ a new foreign key constraint with NOT VALID first on a large table, then validate it separately to avoid a long lock.'
We 'add' a constraint — the standard, simple collocation for creating it, here in its unvalidated form to minimise locking. The other options are less idiomatic here.
5 / 5
Fill in: 'We ___ existing data against the new constraint before adding it, so a violating row doesn't block the migration halfway through.'
We 'check' data — the standard, simple collocation for validating existing rows before enforcing a new rule. The other options are less idiomatic here.