I'm trying to think of a way to automatically remove a row from a table, when the last foreign key reference to it, is dropped. - That is I'm looking for a sort of garbage collection.
I've been trying different approaches, alike reference counting, however I was thinking if it would be achievable using the on delete and on update actions?