pg_statvfs
pg_statvfs : Server filesystem capacity and inode statistics through statvfs
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 6470 | pg_statvfs | pg_statvfs | 1.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 | system_stats pgnodemx pgexporter_ext pg_proctab |
Packages
| Type | Repo | Version | PG Major Compatibility | Package Pattern | Dependencies |
|---|---|---|---|---|---|
| EXT | PIGSTY | 1.0 |
18 17 16 15 14 | pg_statvfs |
- |
| RPM | PIGSTY | 1.0 |
18 17 16 15 14 | pg_statvfs_$v |
- |
| DEB | PIGSTY | 1.0 |
18 17 16 15 14 | postgresql-$v-pg-statvfs |
- |
| Linux / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
| el8.x86_64 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 |
| el8.aarch64 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 |
| el9.x86_64 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 |
| el9.aarch64 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 |
| el10.x86_64 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 |
| el10.aarch64 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 |
| d12.x86_64 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 |
| d12.aarch64 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 |
| d13.x86_64 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 |
| d13.aarch64 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 |
| u22.x86_64 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 |
| u22.aarch64 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 |
| u24.x86_64 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 |
| u24.aarch64 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 |
| u26.x86_64 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 |
| u26.aarch64 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 | PIGSTY 1.0 |
Source
github.com/michaelpq/pg_plugins/tree/ae57c1f3df697fb942f4576f873a655187193ace/pg_statvfs
pg_plugins-ae57c1f3df69.tar.gz
Install
Make sure PGDG and PIGSTY repo available:
Install this extension with pig:
Create this extension with:
Usage
Sources:
pg_statvfs 1.0 exposes filesystem capacity, inode availability, and mount flags through the server’s statvfs call. It inspects the filesystem containing a server-side path, not a client directory or the size of an individual relation.
Core Workflow
After installing the extension files, use a superuser session:
Result and Access
pg_statvfs(path text) returns one record. f_bsize is the preferred block size; f_frsize is the unit for block counts. f_blocks, f_bfree, and f_bavail report total, free, and unprivileged-available blocks. f_files, f_ffree, and f_favail describe inode counts; f_fsid, f_namemax, and flags expose filesystem identity, name limits, and supported mount flags.
The C function explicitly requires superuser privileges and validates the path before asking the operating system. Missing or inaccessible paths produce an error. The extension needs no preload or restart of its own. Its control file permits relocation, but does not mark it trusted. The upstream subdirectory does not declare a complete PostgreSQL-major compatibility matrix; operating-system support and mount-flag coverage also vary.