Deleting from one table also deletes from other table

Clash Royale CLAN TAG#URR8PPP
Deleting from one table also deletes from other table
Postgres on Linux
When I do the following command.
DELETE FROM some_table;
It also deletes data from another table. How do I found out how?
When I do
d some_table, I don't see foreign key or delete on cascade.– BioRod
Aug 8 at 15:01
d some_table
1 Answer
1
There is probably a foreign key constraint that points to your table and is defined with ON DELETE CASCADE.
ON DELETE CASCADE
Alternatively, there may be a trigger on the table that deletes the rows.
In psql, use d some_table to see all such foreign keys and triggers.
psql
d some_table
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
You have a on delete cascade constraint on this table to the other that the registries are being deleted
– Jorge Campos
Aug 8 at 14:51