referential action
The rule, declared on a foreign key, for what happens to child rows when the parent row they point at is deleted or changed.
In more detail
NO ACTION and RESTRICT refuse the delete while children exist, the safe default. CASCADE deletes the children too, and SET NULL keeps the children but clears their pointer. The choice belongs in the schema, not in each DELETE statement.
Related terms
- CASCADE — A foreign key action that deletes child rows automatically when their parent row is deleted.
- foreign key — A column holding another table's primary key value, which the database guarantees points at a row that exists.
- DELETE statement — The SQL statement that removes rows from a table, choosing them with WHERE.
Taught in
- Keys, Constraints And Referential Integrity — PostgreSQL, Indexing & Relational Data Modeling