Skip to content
Advertisement

Tag: cascade

PostgreSQL: FOREIGN KEY/ON DELETE CASCADE

I have two tables like here: So the logic is simple, after user removes all book under category x, x gets removed from cats, i tried method above but doesn’t work, after i clean table book, table category still populated, what’s wrong? Answer A foreign key with a cascade delete means that if a record in the parent table is

Advertisement