foxygen
foxygen

Reputation: 1388

Need to drop 900+ postgres schemas but it wants me to vacuum first

I have 900+ postgres schemas (which collectively hold 40,000 tables) that I'd like to drop. However, it appears that it wants me to vacuum everything first, because I get this whenever I try to drop a schema.

ERROR:  database is not accepting commands to avoid wraparound data loss in database 

Is there a way to drop a large number of schemas without having to vacuum first?

Upvotes: 1

Views: 405

Answers (3)

Deepak gupta
Deepak gupta

Reputation: 554

IS there any problem is running the vacuum command. It is like a garbage collection for a database. I use postgre database and I use this command before doing any major work like backup or creating a sql scripts of the whole database.

VACUUM reclaims storage occupied by dead tuples. In normal PostgreSQL operation, tuples that are deleted or obsoleted by an update are not physically removed from their table; they remain present until a VACUUM is done. Therefore it's necessary to do VACUUM periodically, especially on frequently-updated tables.

Upvotes: 2

A. Scherbaum
A. Scherbaum

Reputation: 855

There is not much you can do, except VACUUM oder dropping the database.

In addition, if you don't do the VACUUM, the database will not work for anything, not just for the schemas you want to drop.

Upvotes: 0

Jasen
Jasen

Reputation: 12392

You've got two choices. Do the vacuum, or drop the whole database. xid wrap-around must be avoided.

https://blog.sentry.io/2015/07/23/transaction-id-wraparound-in-postgres

Upvotes: 0

Related Questions