---
name: "pgstat"
section: "1"
platform: "linux"
package: "pgstat"
version: "1.4.0-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/pgstat"
---

# pgstat(1)

Gather statistical informations from PostgreSQL the vmstat way

## NAME

pgstat - Gather statistical informations from PostgreSQL the vmstat way

## DESCRIPTION

pgstat gathers statistics from a PostgreSQL database.

### Usage:

-

  pgstat \[OPTIONS\] \[delay \[count\]\]

### General options:

- **-f** FILTER

  include only this object (only works for database, table, tableio,

- index, function, statement statistics,

  replication slots, and slru)

- **-H**

  display human-readable values

- **-n**

  do not redisplay header

- **-s** STAT

  stats to collect

- **-S** SUBSTAT

  part of stats to display (only works for database and statement)

- **-v**

  verbose

- \-?\|--help

  show this help, then exit

- **-V**\|--version

  output version information, then exit

### Connection options:

- **-h** HOSTNAME

  database server host or socket directory

- **-p** PORT

  database server port number

- **-U** USER

  connect as specified database user

- **-d** DBNAME

  database to connect to

The default stat is pg\_stat\_bgwriter, but you can change it with the **-s** command line option, and one of its value (STAT):

- \* archiver

  for pg\_stat\_archiver (only for 9.4+)

- \* bgwriter

  for pg\_stat\_bgwriter

- \* buffercache

  for pg\_buffercache (needs the extension)

- \* checkpointer

  for pg\_stat\_bgwriter (\<17) or for pg\_stat\_checkpointer (17+)

- \* connection

  (only for 9.2+)

- \* database

  for pg\_stat\_database

- \* table

  for pg\_stat\_all\_tables

- \* tableio

  for pg\_statio\_all\_tables

- \* index

  for pg\_stat\_all\_indexes

- \* function

  for pg\_stat\_user\_function

- \* statement

  for pg\_stat\_statements (needs the extension)

- \* slru

  for pg\_stat\_slru (only for 13+)

- \* xlog

  for xlog writes (only for 9.2+)

- \* deadlive

  for dead/live tuples stats

- \* repslots

  for replication slots

- \* tempfile

  for temporary file usage

- \* waitevent

  for wait events usage

- \* wal

  for pg\_stat\_wal (only for 14+)

- \* progress\_analyze

  for analyze progress monitoring (only for 13+)

- \* progress\_basebackup

  for base backup progress monitoring (only for 13+)

- \* progress\_cluster

  for cluster progress monitoring (only for 12+)

- \* progress\_copy

  for copy progress monitoring (only for 14+)

- \* progress\_createindex for create index progress monitoring (only

  for 12+)

- \* progress\_vacuum

  for vacuum progress monitoring (only for 9.6+)

- \* pbpools

  for pgBouncer pools statistics

- \* pbstats

  for pgBouncer statistics

## REPORTING BUGS

Report bugs to \<guillaume@lelarge.info\>.
