I accidentally deleted all the records from 3 tables in PostgreSQL. How can i restore the data?
Asked
Active
Viewed 7.5k times
18
-
1Have you got a database backup from yesterday? – cha Nov 21 '13 at 06:01
-
i got nothing,,, is there any recovery method? – v0ld3m0rt Nov 21 '13 at 06:05
-
3You're probably out of luck. I think [Craig Ringer](http://stackoverflow.com/users/398670/craig-ringer) wrote a big answer about this but it might be over on dba.stackexchange.com. – mu is too short Nov 21 '13 at 06:07
-
can't i do anything to get my data back?? – v0ld3m0rt Nov 21 '13 at 06:23
-
1@user236928 Not without serious data recovery expertise, which costs serious money. You told the database to delete the data, so it did. Recovery is only possible if the server hasn't yet overwritten the data. Read http://stackoverflow.com/questions/12472318/can-i-rollback-a-transaction-ive-already-committed-data-loss – Craig Ringer Nov 21 '13 at 06:25
1 Answers
16
This is a similar problem as discussed here:
Can I rollback a transaction I've already committed? (data loss)
Basically, restore from backup. If you can't, you might be able to recover with pg_dirtyread
.
If you don't have backups, stop the whole server, take a disk image of the drive, and contact a $lots data recovery expert.

Community
- 1
- 1

Craig Ringer
- 307,061
- 76
- 688
- 778