简体   繁体   English

postgres删除然后pg_dump转储删除的数据

[英]postgres delete then pg_dump dumping deleted data

Using postgres 9.5.5 使用Postgres 9.5.5

I'm running a script that does a 我正在运行一个脚本

DELETE FROM hugetable

where the table 'hugetable' is large and has many millions of rows. 其中“ hugetable”表很大并且有数百万行。 I then do a pg_dump on the database and the dump still contains all the data in the table 'hugetable' that I thought was just deleted. 然后,我在数据库上执行pg_dump,转储仍然包含我认为刚刚删除的表“ hugetable”中的所有数据。 I've tried using TRUNCATE on the table but we keep getting locking issues. 我尝试在表上使用TRUNCATE,但我们一直遇到锁定问题。 What are some of the solutions to this? 有哪些解决方案? Running VACUUM on the table after I run the DELETE? 运行DELETE后在表上运行VACUUM吗?

您回滚了删除的事务,或者您从未提交过该事务,但该事务仍处于打开状态。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM