8

Official Postgres docs:

"If you simply write:

DELETE FROM products;
then all rows in the table will be deleted! Caveat programmer."

"Caveat programmer"... "Cavea...." "Cave..."

Someone out there is reading this with bloodshot eyes, 3 am, stuck reading this on repeat and prefers that The Ring movie is true and would rather take that...

Comments
  • 2
    ALWAYS use a where clause.
  • 1
    Our production user just has no ability to DELETE (on most tables). That's where softDeletes comes in.
  • 1
    But that's normal db behavior?
  • 1
    @Root you can do it in Oracle, too. It's a great shortcut... to really ruin your day.
  • 1
    @iAmNaN You can do it in every database as far as i'm aware 😋
Add Comment