pg_maintenance(8)

pg_maintenance8

Perform maintenance tasks on all clusters

Usage

pg_maintenance [{-f | --full}] [{-a | --analyze}] [{-v | --verbose}] [--force]

Overview

This script performs maintenance actions on all databases in all clusters. In particular, this calls vacuumdb on all databases, which frees up unused space and helps to improve database performance (if --analyze is specified).

This script is intended to be called regularly in a cronjob.

Options

-c, --cluster version/cluster

Perform maintenance only on specified cluster. By default, all clusters are handled.

-f, --full

Perform a "full vacuum", which is more effective but takes more time and needs to completely lock tables while working on it.

-a, --analyze

Perform some statistical analyses on the tables which helps to improve database performance. This only needs read access to the tables, thus does not require any locking.

-v, --verbose

Passed to vacuumdb, which prints lots of information about the vacuuming and analysis.

--force

By default a cluster is not processed if autovacuuming is enabled for it. If this option is specified, the cluster is processed regardless of the autovacuum daemon status.

Releases

2 releases since Debian 4.0 (Etch); the text changed 1 time.

  1. 4.0
  2. 5.0

Author

Martin Pitt <[email protected]>

From postgresql-common 94lenny1 in Debian 5.0 (Lenny). Parsed by carta from the page's man source.