pg_freespacemap

The pg_freespacemap module provides a means for examining the free space map (FSM). It provides a function called pg_freespace, or two overloaded functions, to be precise. The functions show the value recorded in the free space map for a given page, or for all pages in the relation. By default public access is revoked from the functions, just in case there are security issues lurking. F.26.1. Functions pg_freespace(rel regclass IN, blkno bigint IN) returns int2 Returns the amount of

pg_dumpall

Namepg_dumpall -- extract a PostgreSQL database cluster into a script file Synopsis pg_dumpall [connection-option...] [option...] Description pg_dumpall is a utility for writing out ("dumping") all PostgreSQL databases of a cluster into one script file. The script file contains SQL commands that can be used as input to psql to restore the databases. It does this by calling pg_dump for each database in a cluster. pg_dumpall also dumps global objects that are common to all databases. (pg_

pg_dump

Namepg_dump -- extract a PostgreSQL database into a script file or other archive file Synopsis pg_dump [connection-option...] [option...] [dbname] Description pg_dump is a utility for backing up a PostgreSQL database. It makes consistent backups even if the database is being used concurrently. pg_dump does not block other users accessing the database (readers or writers). pg_dump only dumps a single database. To backup global objects that are common to all databases in a cluster, such a

pg_ctl

Namepg_ctl -- initialize, start, stop, or control a PostgreSQL server Synopsis pg_ctl init[db] [-s] [-D datadir] [-o initdb-options] pg_ctl start [-w] [-t seconds] [-s] [-D datadir] [-l filename] [-o options] [-p path] [-c] pg_ctl stop [-W] [-t seconds] [-s] [-D datadir] [-m s[mart] | f[ast] | i[mmediate] ] pg_ctl restart [-w] [-t seconds] [-s] [-D datadir] [-c] [-m s[mart] | f[ast] | i[mmediate] ] [-o options] pg_ctl reload [-s] [-D datadir] pg_ctl status [-D datadir] pg_ctl promote [-s]

pg_controldata

Namepg_controldata -- display control information of a PostgreSQL database cluster Synopsis pg_controldata [option] [[-D] datadir] Description pg_controldata prints information initialized during initdb, such as the catalog version. It also shows information about write-ahead logging and checkpoint processing. This information is cluster-wide, and not specific to any one database. This utility can only be run by the user who initialized the cluster because it requires read access to the

pg_config

Namepg_config -- retrieve information about the installed version of PostgreSQL Synopsis pg_config [option...] Description The pg_config utility prints configuration parameters of the currently installed version of PostgreSQL. It is intended, for example, to be used by software packages that want to interface to PostgreSQL to facilitate finding the required header files and libraries. Options To use pg_config, supply one or more of the following options: --bindir Print the location

pg_buffercache

The pg_buffercache module provides a means for examining what's happening in the shared buffer cache in real time. The module provides a C function pg_buffercache_pages that returns a set of records, plus a view pg_buffercache that wraps the function for convenient use. By default public access is revoked from both of these, just in case there are security issues lurking. F.24.1. The pg_buffercache View The definitions of the columns exposed by the view are shown in Table F-16. Table F-16. p

pg_basebackup

Namepg_basebackup -- take a base backup of a PostgreSQL cluster Synopsis pg_basebackup [option...] Description pg_basebackup is used to take base backups of a running PostgreSQL database cluster. These are taken without affecting other clients to the database, and can be used both for point-in-time recovery (see Section 25.3) and as the starting point for a log shipping or streaming replication standby servers (see Section 26.2). pg_basebackup makes a binary copy of the database cluster

pg_archivecleanup

Namepg_archivecleanup -- clean up PostgreSQL WAL archive files Synopsis pg_archivecleanup [option...] archivelocation oldestkeptwalfile Description pg_archivecleanup is designed to be used as an archive_cleanup_command to clean up WAL file archives when running as a standby server (see Section 26.2). pg_archivecleanup can also be used as a standalone program to clean WAL file archives. To configure a standby server to use pg_archivecleanup, put this into its recovery.conf configuration

pgstattuple

The pgstattuple module provides various functions to obtain tuple-level statistics. F.30.1. Functions pgstattuple(regclass) returns record pgstattuple returns a relation's physical length, percentage of "dead" tuples, and other info. This may help users to determine whether vacuum is necessary or not. The argument is the target relation's name (optionally schema-qualified) or OID. For example: test=> SELECT * FROM pgstattuple('pg_catalog.pg_proc'); -[ RECORD 1 ]------+------- tab