Cloud

pg_size_pretty

The pg_size_pretty() is a database object management function that converts sizes in bytes into a human-readable format.

Syntax

pg_size_pretty(size)

Parameters

  • size: Specifies the size in bytes to convert.

Examples

SELECT pg_size_pretty(100);
 pg_size_pretty
----------------
 100 bytes
(1 row)
SELECT pg_size_pretty(1000000);
 pg_size_pretty
----------------
 977 kB
(1 row)