PGSTAT(1)

πŸ’– NAME πŸ’–

pgstat β€” gather statistical informations from PostgreSQL the vmstat way πŸ¦‹


🌸 DESCRIPTION 🌸

okay so bestie, pgstat gathers statistics from a PostgreSQL database. that's it, that's the whole vibe. it's giving vmstat but make it postgres πŸ‘‘

✨ 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 (so like, numbers that don't make your eyes bleed)
  • -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 😭

found a bug? no cap, report it to <guillaume@lelarge.info> 🫢


and that's the whole page bestie!! this was pgstat 1.4.0, dropped October 2024 β€” go forth and monitor those stats, you absolute icon πŸ’…βœ¨πŸ‘‘

πŸ“¦ where this page comes from