Skip to content
system_stats

system_stats

system_stats : EnterpriseDB system statistics for PostgreSQL

Overview

ID Extension Package Version Category License Language
6420
system_stats
system_stats
4.0
STAT
PostgreSQL
C
Attribute Has Binary Has Library Need Load Has DDL Relocatable Trusted
--s-d-r
No
Yes
No
Yes
yes
no
Relationships
See Also
pgnodemx
pg_proctab
pgmeminfo
pgfincore
pg_wait_sampling
pg_buffercache
pg_background
pg_cooldown

Packages

Type Repo Version PG Major Compatibility Package Pattern Dependencies
EXT
MIXED
4.0
18
17
16
15
14
system_stats -
RPM
PGDG
4.0
18
17
16
15
14
system_stats_$v -
DEB
PIGSTY
4.0
18
17
16
15
14
postgresql-$v-system-stats -
Linux / PG PG18 PG17 PG16 PG15 PG14
el8.x86_64
PGDG 4.0
PGDG 4.0
PGDG 4.0
PGDG 4.0
PGDG 4.0
el8.aarch64
PGDG 4.0
PGDG 4.0
PGDG 4.0
PGDG 4.0
PGDG 4.0
el9.x86_64
PGDG 4.0
PGDG 4.0
PGDG 4.0
PGDG 4.0
PGDG 4.0
el9.aarch64
PGDG 4.0
PGDG 4.0
PGDG 4.0
PGDG 4.0
PGDG 4.0
el10.x86_64
PGDG 4.0
PGDG 4.0
PGDG 4.0
PGDG 4.0
PGDG 4.0
el10.aarch64
PGDG 4.0
PGDG 4.0
PGDG 4.0
PGDG 4.0
PGDG 4.0
d12.x86_64
PIGSTY 4.0
PIGSTY 4.0
PIGSTY 4.0
PIGSTY 4.0
PIGSTY 4.0
d12.aarch64
PIGSTY 4.0
PIGSTY 4.0
PIGSTY 4.0
PIGSTY 4.0
PIGSTY 4.0
d13.x86_64
PIGSTY 4.0
PIGSTY 4.0
PIGSTY 4.0
PIGSTY 4.0
PIGSTY 4.0
d13.aarch64
PIGSTY 4.0
PIGSTY 4.0
PIGSTY 4.0
PIGSTY 4.0
PIGSTY 4.0
u22.x86_64
PIGSTY 4.0
PIGSTY 4.0
PIGSTY 4.0
PIGSTY 4.0
PIGSTY 4.0
u22.aarch64
PIGSTY 4.0
PIGSTY 4.0
PIGSTY 4.0
PIGSTY 4.0
PIGSTY 4.0
u24.x86_64
PIGSTY 4.0
PIGSTY 4.0
PIGSTY 4.0
PIGSTY 4.0
PIGSTY 4.0
u24.aarch64
PIGSTY 4.0
PIGSTY 4.0
PIGSTY 4.0
PIGSTY 4.0
PIGSTY 4.0
u26.x86_64
PIGSTY 4.0
PIGSTY 4.0
PIGSTY 4.0
PIGSTY 4.0
PIGSTY 4.0
u26.aarch64
PIGSTY 4.0
PIGSTY 4.0
PIGSTY 4.0
PIGSTY 4.0
PIGSTY 4.0
Package Version OS ORG SIZE File URL
system_stats_18 4.0 el8.x86_64 pgdg 32.4 KiB system_stats_18-4.0-1PGDG.rhel8.10.x86_64.rpm
system_stats_18 3.2 el8.x86_64 pgdg 28.9 KiB system_stats_18-3.2-2PGDG.rhel8.x86_64.rpm
system_stats_18 3.2.1 el8.x86_64 pgdg 30.3 KiB system_stats_18-3.2.1-1PGDG.rhel8.10.x86_64.rpm
system_stats_18 4.0 el8.aarch64 pgdg 32.0 KiB system_stats_18-4.0-1PGDG.rhel8.10.aarch64.rpm
system_stats_18 3.2 el8.aarch64 pgdg 28.7 KiB system_stats_18-3.2-2PGDG.rhel8.aarch64.rpm
system_stats_18 3.2.1 el8.aarch64 pgdg 30.0 KiB system_stats_18-3.2.1-1PGDG.rhel8.10.aarch64.rpm
system_stats_18 4.0 el9.x86_64 pgdg 31.3 KiB system_stats_18-4.0-1PGDG.rhel9.7.x86_64.rpm
system_stats_18 3.2 el9.x86_64 pgdg 28.4 KiB system_stats_18-3.2-2PGDG.rhel9.x86_64.rpm
system_stats_18 3.2.1 el9.x86_64 pgdg 29.6 KiB system_stats_18-3.2.1-1PGDG.rhel9.7.x86_64.rpm
system_stats_18 4.0 el9.aarch64 pgdg 31.2 KiB system_stats_18-4.0-1PGDG.rhel9.7.aarch64.rpm
system_stats_18 3.2 el9.aarch64 pgdg 28.3 KiB system_stats_18-3.2-2PGDG.rhel9.aarch64.rpm
system_stats_18 3.2.1 el9.aarch64 pgdg 29.3 KiB system_stats_18-3.2.1-1PGDG.rhel9.7.aarch64.rpm
system_stats_18 4.0 el10.x86_64 pgdg 32.1 KiB system_stats_18-4.0-1PGDG.rhel10.1.x86_64.rpm
system_stats_18 3.2 el10.x86_64 pgdg 29.6 KiB system_stats_18-3.2-2PGDG.rhel10.x86_64.rpm
system_stats_18 3.2.1 el10.x86_64 pgdg 30.3 KiB system_stats_18-3.2.1-1PGDG.rhel10.1.x86_64.rpm
system_stats_18 4.0 el10.aarch64 pgdg 31.5 KiB system_stats_18-4.0-1PGDG.rhel10.1.aarch64.rpm
system_stats_18 3.2 el10.aarch64 pgdg 28.8 KiB system_stats_18-3.2-2PGDG.rhel10.aarch64.rpm
system_stats_18 3.2.1 el10.aarch64 pgdg 29.6 KiB system_stats_18-3.2.1-1PGDG.rhel10.1.aarch64.rpm
postgresql-18-system-stats 4.0 d12.x86_64 pigsty 67.3 KiB postgresql-18-system-stats_4.0-1PIGSTY~bookworm_amd64.deb
postgresql-18-system-stats 4.0 d12.aarch64 pigsty 66.4 KiB postgresql-18-system-stats_4.0-1PIGSTY~bookworm_arm64.deb
postgresql-18-system-stats 4.0 d13.x86_64 pigsty 67.4 KiB postgresql-18-system-stats_4.0-1PIGSTY~trixie_amd64.deb
postgresql-18-system-stats 4.0 d13.aarch64 pigsty 66.3 KiB postgresql-18-system-stats_4.0-1PIGSTY~trixie_arm64.deb
postgresql-18-system-stats 4.0 u22.x86_64 pigsty 70.2 KiB postgresql-18-system-stats_4.0-1PIGSTY~jammy_amd64.deb
postgresql-18-system-stats 4.0 u22.aarch64 pigsty 70.2 KiB postgresql-18-system-stats_4.0-1PIGSTY~jammy_arm64.deb
postgresql-18-system-stats 4.0 u24.x86_64 pigsty 70.0 KiB postgresql-18-system-stats_4.0-1PIGSTY~noble_amd64.deb
postgresql-18-system-stats 4.0 u24.aarch64 pigsty 69.4 KiB postgresql-18-system-stats_4.0-1PIGSTY~noble_arm64.deb
postgresql-18-system-stats 4.0 u26.x86_64 pigsty 69.7 KiB postgresql-18-system-stats_4.0-1PIGSTY~resolute_amd64.deb
postgresql-18-system-stats 4.0 u26.aarch64 pigsty 68.9 KiB postgresql-18-system-stats_4.0-1PIGSTY~resolute_arm64.deb

Source

pig build pkg system_stats;		# build deb

Install

Make sure PGDG and PIGSTY repo available:

pig repo add pgsql -u   # add both repo and update cache

Install this extension with pig:

pig install system_stats;		# install via package name, for the active PG version

pig install system_stats -v 18;   # install for PG 18
pig install system_stats -v 17;   # install for PG 17
pig install system_stats -v 16;   # install for PG 16
pig install system_stats -v 15;   # install for PG 15
pig install system_stats -v 14;   # install for PG 14

Create this extension with:

CREATE EXTENSION system_stats;

Usage

Source: README, Release v4.0, SQL install script

system_stats exposes operating-system metrics through SQL functions. It supports Linux, macOS, and Windows, returning NULL for fields that are not meaningful on the current platform.

Main functions

CREATE EXTENSION system_stats;

SELECT * FROM pg_sys_os_info();
SELECT * FROM pg_sys_cpu_info();
SELECT * FROM pg_sys_cpu_usage_info();
SELECT * FROM pg_sys_memory_info();
SELECT * FROM pg_sys_io_analysis_info();
SELECT * FROM pg_sys_disk_info();
SELECT * FROM pg_sys_load_avg_info();
SELECT * FROM pg_sys_process_info();
SELECT * FROM pg_sys_network_info();
SELECT * FROM pg_sys_cpu_memory_by_process();

These functions cover OS identity, CPU inventory and usage, memory, block-device I/O, disks, load average, process counts, network interfaces, and per-process CPU and memory usage.

Access control

GRANT monitor_system_stats TO nagios;
GRANT EXECUTE ON FUNCTION pg_sys_os_info() TO pg_monitor;
  • The extension creates a monitor_system_stats role and grants execution on the shipped functions to that role.
  • Functions are revoked from PUBLIC.

Caveats

  • The monitor_system_stats role is not dropped automatically when the extension is removed.
  • macOS cannot expose full per-process details for processes owned by other users; those rows may contain only PID and process name.
  • Current v4.0 upstream docs keep the same user-facing function family and security model; the refresh here mainly aligns names, privileges, and platform notes with the current README and SQL script.
Last updated on