V
V
Vladimir2019-02-01 14:42:46
PostgreSQL
Vladimir, 2019-02-01 14:42:46

How to get the total size of a Postgresql cluster (the sum of the size of all databases on the server)?

How to get the total size of the Postgresql cluster (the sum of the size of all databases on the server) using sql query?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Melkij, 2019-02-01
@idskill

select sum(pg_catalog.pg_database_size(d.datname)) from pg_catalog.pg_database d;

That's just the total size of the cluster is not the same as the sum of the size of all databases. The cluster size is counted as du -s from $PGDATA

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question