pg_size_pretty ( bigint ) → textConverts a size in bytes into a more easily human-readable format with size units (bytes, kB, MB, GB, TB, or PB as appropriate). Note that the units are powers of 2 rather than powers of 10, so 1kB is 1024 bytes, 1MB is 10242 = 1048576 bytes, and so on.
FUNCTIONS / SYSTEM ADMINISTRATION FUNCTIONS
pg_size_pretty
Read PG 18 manual ↗Converts a size in bytes into a more easily human-readable format with size units (bytes, kB, MB, GB, TB, or PB as appropriate).
Signatures & examples
pg_size_pretty ( numeric ) → textConverts a size in bytes into a more easily human-readable format with size units (bytes, kB, MB, GB, TB, or PB as appropriate). Note that the units are powers of 2 rather than powers of 10, so 1kB is 1024 bytes, 1MB is 10242 = 1048576 bytes, and so on.
Version history 3
- PG 14 → 15changed
- PG 12 → 13changed
- PG 9.1 → 9.2changed
Definition snapshot: 2026-09-14T13:14:25.684213+00:00@99e6866c · English manual source