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
|
Source
pig build pkg system_stats; # build debInstall
Make sure PGDG and PIGSTY repo available:
pig repo add pgsql -u # add both repo and update cacheInstall 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 14Create 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_statsrole and grants execution on the shipped functions to that role. - Functions are revoked from
PUBLIC.
Caveats
- The
monitor_system_statsrole 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