logoalt Hacker News

ahartmetztoday at 6:09 PM3 repliesview on HN

I haven't used stored procedures yet, but even ON DELETE CASCADE is super convenient and I suspect somewhat underused by SQL scaredy cats.


Replies

lelanthrantoday at 6:41 PM

> I haven't used stored procedures yet, but even ON DELETE CASCADE is super convenient and I suspect somewhat underused by SQL scaredy cats.

Sooner or later you are going to hit enter, wait a few seconds and say "oops!"

sulamtoday at 7:09 PM

I think the stored procedure equivalent would be a "on delete, cascade these tombstones" -- both safer and cleaner.

wavemodetoday at 6:23 PM

ON DELETE CASCADE is horrendously unsafe unless you have full understanding of the entire data model - which is unlikely for the average employee within a large organization with a gigantic database. (And it's also rare to be permanently deleting data when working in such a context, so the convenience doesn't matter that much.)

show 1 reply