Search code examples
ruby-on-railspostgresqlherokupgheroku-postgres

Check db status through DATABASE_URL


I've been given access to Heroku application with rather strange setup. It has one database but when I run heroku config, I get different DATABASE_URL and HEROKU_POSTGRESQL_BRONZE_URL. When I run heroku pg:info I get the following result:

=== HEROKU_POSTGRESQL_BRONZE_URL
Plan:        Dev
Status:      available
Connections: 1
PG Version:  9.2.4
Created:     2013-09-05 11:02 UTC
Data Size:   6.5 MB
Tables:      0
Rows:        0/10000 (In compliance)
Fork/Follow: Unsupported

I realised that my database is at DATABASE_URL, but I can't access that database, only through heroku run console. All heroku pg commands fail with this message:

!    Unknown database: DATABASE_URL. Valid options are: HEROKU_POSTGRESQL_BRONZE_URL

If I run heroku pg HEROKU_POSTGRESQL_BRONZE_URL, I get access to empty database from above.

Since I have some issues with running migrations, I think my database might be full, and I'd like to check it. Any ideas how I can do that?

Here's the error after I run heroku run rake db:migrate:

PG::Error: ERROR:  permission denied for relation schema_migrations
: INSERT INTO "schema_migrations" ("version") VALUES ('20130918114202')

More information about the setup:

rails 3.2.12

RAILS_ENV: staging (I don't have access to production, but I know this is "dev" server and there's also real "staging" from which this app was forked).


Solution

  • This seems like something screwy on the Heroku side. Have you tried submitting a ticket with them? I've always had good luck with their support.