Answers for "postgres query to get size of database"


how to get the size of the database in postgresql

SELECT pg_size_pretty( pg_database_size('dbname') );
Posted by: Guest on February-09-2021

postgres database sizes

/* For multiple databases */
select t1.datname AS db_name,  
       pg_size_pretty(pg_database_size(t1.datname)) as db_size
from pg_database t1
order by pg_database_size(t1.datname) desc;
Posted by: Guest on July-07-2021

Code answers related to "postgres query to get size of database"

Code answers related to "SQL"

Browse Popular Code Answers by Language