↑↓ select ↵ open ⌫ change scope Open full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

Functions / System Administration Functions

pg_total_relation_size

Read the PG 18 manual

Computes the total disk space used by the specified table, including all indexes and TOAST data.

Reading PG 18current·documented in 22 of 27 versions, 8.1 to 20

Signatures & examples

pg_total_relation_size ( regclass ) → bigint
Computes the total disk space used by the specified table, including all indexes and TOAST data. The result is equivalent to pg_table_size + pg_indexes_size.
Version history 5
  1. 12 → 13 changed
  2. 9.0 → 9.1 changed
  3. 8.4 → 9.0 changed
  4. 8.3 → 8.4 changed
  5. 8.0 → 8.1 added

Definition snapshot: b7bd9cda · English manual source