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 the PG 18 manualConverts a size in bytes into a more easily human-readable format with size units (bytes, kB, MB, GB, TB, or PB as appropriate).
Reading PG 18current·documented in 22 of 27 versions, 8.1 to 20
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.
Definition snapshot: b7bd9cda · English manual source