Skip to content

Instantly share code, notes, and snippets.

@martineg
Last active January 4, 2016 16:29
Show Gist options
  • Save martineg/8647474 to your computer and use it in GitHub Desktop.
Save martineg/8647474 to your computer and use it in GitHub Desktop.
PostgreSQL snippets
SELECT d.datname AS Name,
pg_catalog.pg_get_userbyid(d.datdba) AS Owner,
pg_catalog.pg_size_pretty(pg_catalog.pg_database_size(d.datname)) as size
FROM pg_catalog.pg_database d
ORDER BY pg_catalog.pg_database_size(d.datname);
@Paxa
Copy link

Paxa commented Jul 4, 2015

It list all databases with their owner and size on disk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment