Postgres DB Size Command

Beautiful Mind picture Beautiful Mind · Sep 20, 2013 · Viewed 241.8k times · Source

What is the command to find the size of all the databases?

I am able to find the size of a specific database by using following command:

select pg_database_size('databaseName');

Answer

Ashish picture Ashish · Jun 2, 2014

You can enter the following psql meta-command to get some details about a specified database, including its size:

\l+ <database_name>

And to get sizes of all databases (that you can connect to):

\l+