Answers for "postgresql database size"

SQL
5

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
3

postgres check size table

SELECT pg_size_pretty( pg_total_relation_size('tablename') );
Posted by: Guest on June-15-2020
1

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
1

find size of all DB's postgres

CopySELECT pg_database.datname as "database_name", pg_database_size(pg_database.datname)/1024/1024 AS size_in_mb FROM pg_database ORDER by size_in_mb DESC;
Posted by: Guest on April-27-2020

Code answers related to "postgresql database size"

Code answers related to "SQL"

Browse Popular Code Answers by Language