Quickest way to find out heroku database size
running heroku info
shows:
Data size: 480k
Addons: Basic Logging, Shared Database 5MB
Data size being the size of the shared database, here with a limit of 5MB.
From the same doc page as posted by nate c:
heroku pg:info
This only seems to work if you're not using the shared DB, but using PG as an add-on
Also, make sure your heroku gem is up to date:
sudo gem update heroku
Any ideas on how to see the size of a shared db? I just did a heroku db:pull and then a mysqldump and looked at the file size, figured that was a good rough estimate.
The new way seems to be:
heroku pg:info -a myapp
You'll see something like:
=== HEROKU_POSTGRESQL_PURPLE_URL (DATABASE_URL)
Plan: Dev
Status: available
Connections: 1
PG Version: 9.1.5
Created: 2012-10-19 01:27 UTC
Data Size: 12.1 MB
Tables: 31
Rows: 36068/10000 (Above limits, access disruption imminent)
Fork/Follow: Unavailable
Based on Nate's answer:
For shared DB w/o installing Postgres on your local machine
heroku console
ActiveRecord::Base.connection.execute("SELECT pg_size_pretty(pg_database_size('postgres'))").first
'postgres' is the name of my shared DB, when I put in template0 or template1 I get the same number back.