Comment by kamatour
Why can't databases just remember stuff we delete, like a trash can?
Why can't databases just remember stuff we delete, like a trash can?
They do if you tell them. Both Oracle, mssql and postgresql have this implemented. I only used it in Oracle - it's called flashback queries - you do SELECT ... AS OF timestamp and you can see state of the table from the past.
It needs to be enabled tho, and it has some problems (for example you need to remove data for legal reasons sometimes).
Reading this in thread is very frustrating with people reinventing the wheel and asking why it wasn't invented already:)
Assuming you're serious, there are two main reasons. You want to regain storage space after you delete things, and sometimes you want to actually delete things (e.g. to be in compliance with regulations).