Saturday, October 16, 2010

Query to get database size and location in Postgresql

0 comments
Postgresql 8.1

select d.oid, datname,datdba, pg_size_pretty(pg_database_size(datname)) as size, t.*
from pg_database as d
inner join pg_tablespace as t on  ( d.dattablespace  = t.oid)
order by pg_database_size(datname)  desc

Leave a Reply

Labels