且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在PostgreSQL中回滚更新

更新时间:2022-12-17 15:21:14

我假设这是已经提交的事务?如果是这样,那就是提交的意思,您将无法返回。

I'm assuming it was a transaction that's already committed? If so, that's what "commit" means, you can't go back.

如果幸运的话,某些数据可以恢复。立即停止数据库。

Some data may be recoverable if you're lucky. Stop the database NOW.

这是我之前针对同一主题写的一个答案。我希望它会有所帮助。

Here's an answer I wrote on the same topic earlier. I hope it's helpful.

这可能也是:在postgresql中删除已删除的行

除非数据绝对关键,仅从备份中还原,否则会容易得多,也不会那么痛苦。如果您没有备份,请考虑一下自己。

Unless the data is absolutely critical, just restore from backups, it'll be lots easier and less painful. If you didn't have backups, consider yourself soundly thwacked.