If you are not as lucky and need to attack the underlying files to recover as much as you can in CSV form, try my small tool: <a href="https://github.com/csdvrx/pg_csdvrx" rel="nofollow">https://github.com/csdvrx/pg_csdvrx</a><p>Or just watch the demo on <a href="https://raw.githubusercontent.com/csdvrx/pg_csdvrx/master/pg_csdvrx.gif" rel="nofollow">https://raw.githubusercontent.com/csdvrx/pg_csdvrx/master/pg...</a> where I corrupt a table to show how it works
And for next time. <a href="https://gist.github.com/AtulKsol/520f5d0c9a313edea7254701f6db8966" rel="nofollow">https://gist.github.com/AtulKsol/520f5d0c9a313edea7254701f6d...</a>
It's quite easy to have a copy of a Postgresql instance running on another host with streaming replication (always up to date).<p>This and backups will avoid great sorrows.
Hope this helps someone out there.<p><a href="https://github.com/wal-e/wal-e" rel="nofollow">https://github.com/wal-e/wal-e</a><p>^^ stream your write ahead logs to s3 + all the other bells and whistles you'd expect<p>Standard issue reminder, test your backups or they're not backups at all.