Book Image

PostgreSQL 9 Administration Cookbook - Second Edition

Book Image

PostgreSQL 9 Administration Cookbook - Second Edition

Overview of this book

Table of Contents (19 chapters)
PostgreSQL 9 Administration Cookbook Second Edition
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Avoiding transaction wraparound


To many users, transaction wraparound sounds like a disease from space. Mentioning transaction wraparound usually earns the speaker points for technical merit. Let's take a look at it and how to avoid it.

Getting ready

First of all, have you ever seen this message?

WARNING: database "postgres" must be vacuumed within XXX transactions.
HINT: To avoid a database shutdown, execute a database-wide VACUUM in that database.
You might also need to commit or roll back old prepared transactions.

Even worse is the following message:

ERROR: database is not accepting commands to avoid wraparound data loss in database "template0"
HINT:  Stop the postmaster and use a standalone backend to vacuum that database.
You might also need to commit or roll back old prepared transactions.

If not, then you don't need to do anything apart from normal planned maintenance. These messages are reported to users, and they are also written to the server log.

How to do it…

If you have a support...