3 ms·
And this is why we use things like database users that don't have delete permission, and row-level security so users can delete things that don't belong to them
by onion2k 5y ago
And this is why we use things like database users that don't have delete permission, and row-level security so users can delete things that don't belong to them.
I have learned this from a very similar experience.
- bombcar 5y agoAnd why it’s often best to mark a record deleted and then have a reaper remove the records at a later point. But you must make sure all normal queries don’t see deleted items.
- truetraveller 5y agoThat's over engineering. At this point, just rely on PITR. FWIW, postgres does have a "reaper" via vacuum, but not for the purpose of safety. but rather to allow for mvcc.
- brutal_chaos_ 5y agoHi, if I may, what does PITR stand for?
- syncdk 5y agohttps://en.wikipedia.org/wiki/Point-in-time_recovery https://en.wikipedia.org/wiki/Point-in-time_recovery
- brutal_chaos_ 5y agoThanks!
- yyyk 5y agoThere are other advantages for soft-deletes, like not having to worry about FKs.