Alex Rivera | Logout

Quickest way to find out heroku database size

Asked 2010-11-18T22:23:13.670
54

What is the quickest way to find out the current size of my shared database in Heroku?

Edit
Report

2 Answers

13

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
answered 2012-10-23T16:29:08.440
7

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.

answered 2011-01-12T17:24:20.787

Your Answer