Question : how to get the size of the database in postgresql
Answered by : cloudy-caiman-hyvluwvwaio3
SELECT pg_size_pretty( pg_database_size('dbname') );
Source : https://www.a2hosting.in/kb/developer-corner/postgresql/determining-the-size-of-postgresql-databases-and-tables | Last Update : Tue, 16 Feb 21
Question : postgres database sizes
Answered by : martin-cornel
/* 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;
Source : https://stackoverflow.com/questions/18907047/postgres-db-size-command | Last Update : Wed, 14 Jul 21
Question : find size of all DB's postgres
Answered by : excited-elk-dgooadynnv0y
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;
Source : https://makandracards.com/makandra/37935-postgresql-show-size-of-all-databases | Last Update : Mon, 04 May 20
Question : postgresql size of database
Answered by : kennedy-carvalho
SELECT pg_database_size('named_db');
SELECT pg_size_pretty(pg_database_size('named_db'));
Source : https://jonathanstreet.com/blog/disk-space-database-table-mysql-postgresql/ | Last Update : Tue, 30 Aug 22