I prepared a fiddle which demonstrates the problem.
CREATE TABLE parent (
parent_id integer primary key
);
CREATE TABLE child (
child_name TEXT primary key,
parent_id integer REFERENCES parent (parent_id) ON DELETE CASCADE
);
INSERT INTO parent VALUES (1);
INSERT INTO child VALUES ('michael',1), ('vanessa', 1);
I want a way for the delete to CASCADE to the parent record when a child record is deleted.
For example:
DELETE FROM child WHERE child_name='michael';
This should cascade to the parent table and remove the record.