Glossary: PostgreSQL Beyond the Basics
pg_relation_size, pg_total_relation_size, pg_size_pretty
Also written: pg_relation_size, pg_total_relation_size, pg_size_pretty, pg_database_size
Functions for sizes. `pg_relation_size` gives the bytes of one table or index, `pg_total_relation_size` adds the table's indexes, and `pg_size_pretty` makes bytes readable.