pg_proctab
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
pgnodemx | 1.7 | STAT | BSD 3-Clause | C |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 6440 | pgnodemx | No | Yes | No | Yes | No | Yes | - |
| 6450 | pg_proctab | No | Yes | No | Yes | No | Yes | - |
| Related | prioritize system_stats pg_background pg_wait_sampling pgmeminfo pgsentinel pg_profile |
|---|
from pgnodemx
Version
| Type | Repo | Version | PG Ver | Package | Deps |
|---|---|---|---|---|---|
| EXT | PIGSTY | 1.7 | 1817161514 | pgnodemx | - |
| RPM | PIGSTY | 1.7 | 1817161514 | pgnodemx_$v | - |
| DEB | PIGSTY | 1.7 | 1817161514 | postgresql-$v-pgnodemx | - |
| OS / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
| el8.x86_64 | PIGSTY 1.7 | PIGSTY 1.7 | PIGSTY 1.7 | PIGSTY 1.7 | PIGSTY 1.7 |
| el8.aarch64 | PIGSTY 1.7 | PIGSTY 1.7 | PIGSTY 1.7 | PIGSTY 1.7 | PIGSTY 1.7 |
| el9.x86_64 | PIGSTY 1.7 | PIGSTY 1.7 | PIGSTY 1.7 | PIGSTY 1.7 | PIGSTY 1.7 |
| el9.aarch64 | PIGSTY 1.7 | PIGSTY 1.7 | PIGSTY 1.7 | PIGSTY 1.7 | PIGSTY 1.7 |
| el10.x86_64 | PIGSTY 1.7 | PIGSTY 1.7 | PIGSTY 1.7 | PIGSTY 1.7 | PIGSTY 1.7 |
| el10.aarch64 | PIGSTY 1.7 | PIGSTY 1.7 | PIGSTY 1.7 | PIGSTY 1.7 | PIGSTY 1.7 |
| d12.x86_64 | PGDG 2.0.1 | PGDG 2.0.1 | PGDG 2.0.1 | PGDG 2.0.1 | PGDG 2.0.1 |
| d12.aarch64 | PGDG 2.0.1 | PGDG 2.0.1 | PGDG 2.0.1 | PGDG 2.0.1 | PGDG 2.0.1 |
| d13.x86_64 | PGDG 2.0.1 | PGDG 2.0.1 | PGDG 2.0.1 | PGDG 2.0.1 | PGDG 2.0.1 |
| d13.aarch64 | PGDG 2.0.1 | PGDG 2.0.1 | PGDG 2.0.1 | PGDG 2.0.1 | PGDG 2.0.1 |
| u22.x86_64 | PGDG 2.0.1 | PGDG 2.0.1 | PGDG 2.0.1 | PGDG 2.0.1 | PGDG 2.0.1 |
| u22.aarch64 | PGDG 2.0.1 | PGDG 2.0.1 | PGDG 2.0.1 | PGDG 2.0.1 | PGDG 2.0.1 |
| u24.x86_64 | PGDG 2.0.1 | PGDG 2.0.1 | PGDG 2.0.1 | PGDG 2.0.1 | PGDG 2.0.1 |
| u24.aarch64 | PGDG 2.0.1 | PGDG 2.0.1 | PGDG 2.0.1 | PGDG 2.0.1 | PGDG 2.0.1 |
Build
You can build the RPM / DEB packages for pgnodemx using pig build:
pig build pkg pgnodemx # build RPM / DEB packages
Install
You can install pgnodemx directly. First, make sure the PGDG and PIGSTY repositories are added and enabled:
pig repo add pgsql -u # Add repo and update cache
Install the extension using pig or apt/yum/dnf:
pig install pgnodemx; # Install for current active PG version
pig ext install -y pgnodemx -v 18 # PG 18
pig ext install -y pgnodemx -v 17 # PG 17
pig ext install -y pgnodemx -v 16 # PG 16
pig ext install -y pgnodemx -v 15 # PG 15
pig ext install -y pgnodemx -v 14 # PG 14
dnf install -y pgnodemx_18 # PG 18
dnf install -y pgnodemx_17 # PG 17
dnf install -y pgnodemx_16 # PG 16
dnf install -y pgnodemx_15 # PG 15
dnf install -y pgnodemx_14 # PG 14
apt install -y postgresql-18-pgnodemx # PG 18
apt install -y postgresql-17-pgnodemx # PG 17
apt install -y postgresql-16-pgnodemx # PG 16
apt install -y postgresql-15-pgnodemx # PG 15
apt install -y postgresql-14-pgnodemx # PG 14
Create Extension:
CREATE EXTENSION pg_proctab;
Usage
pg_proctab allows querying operating system process, CPU, memory, disk, and load statistics from within PostgreSQL via SQL functions.
Functions
Process information (pg_proctab()):
-- All PostgreSQL process info
SELECT pid, comm, state, utime, stime, vsize, rss, reads, writes
FROM pg_proctab();
-- Join with pg_stat_activity for per-query resource usage
SELECT a.pid, a.query, p.utime, p.stime, p.vsize, p.rss
FROM pg_stat_activity a
JOIN pg_proctab() p ON a.pid = p.pid;
Returns per-process: pid, comm, fullcomm, state, ppid, utime, stime, priority, nice, num_threads, vsize, rss, processor, uid, username, rchar, wchar, reads, writes, and more.
CPU time (pg_cputime()):
SELECT "user", nice, system, idle, iowait FROM pg_cputime();
Load average (pg_loadavg()):
SELECT load1, load5, load15, last_pid FROM pg_loadavg();
Memory usage (pg_memusage()):
SELECT memused, memfree, memshared, membuffers, memcached,
swapused, swapfree, swapcached
FROM pg_memusage();
Disk usage (pg_diskusage()):
SELECT devname, reads_completed, writes_completed,
sectors_read, sectors_written
FROM pg_diskusage();
Feedback
Was this page helpful?
Thanks for the feedback! Please let us know how we can improve.
Sorry to hear that. Please let us know how we can improve.