Database and Tablespace size-tablespace tarafindan alinan diskalani
Definition Description
SELECT pg_size_pretty(pg_database_size('mydb'))
/* Hepsine tek tek bakacağına, bir kerede bakmak icin */ 1- SELECT 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;
/* GB pg nin kendi fonksiyonu yanina yaziyor. */ 2- SELECT pg_database.datname as "database_name", pg_size_pretty(pg_database_size(pg_database.datname)) AS DBSIZE FROM pg_database ORDER by DBSIZE DESC;
3- SELECT 'SELECT pg_size_pretty(pg_database_size('''||datname||'''));' FROM pg_database;
Disk space occupied by a tablespace: SELECT pg_size_pretty(pg_tablespace_size('mytblspace'))