Is there any command to find all the databases size in Postgres?
I am able to find the size of a specific database by using following command:
select pg_database_size('databaseName');
Is there any command to find all the databases size in Postgres? I am able to find the size of a specific database by using following command:
|
||||
|
Database Size |
|||||
|
You can get the names of all the databases that you can connect to from the "pg_datbase" system table. Just apply the function to the names, as below.
If you intend the output to be consumed by a machine instead of a human, you can cut the pg_size_pretty() function. |
|||||||||
|