Re:What's Coming in PostgreSQL 9.5
by NickNameNick on Thursday July 02, 2015 @08:40PM
(#9822687)
How do you manage referential integrity?
If you have 2 tables, A and B, where B references A
Ideally I couldn't set deleted on row in A until all the rows in B that reference it have also been set to deleted.
If I wasn't using soft deletes, I'd just use a foreign key from B (a_id) to A (a_id), but with soft-deletion, that constraint doesn't get enforced.
If you have 2 tables, A and B, where B references A Ideally I couldn't set deleted on row in A until all the rows in B that reference it have also been set to deleted.
If I wasn't using soft deletes, I'd just use a foreign key from B (a_id) to A (a_id), but with soft-deletion, that constraint doesn't get enforced.