1

I tried doing heroku pg:info and heroku config to get my DATABASE_URL as

DATABASE_URL:             postgres://yyxuzvlrgcccgx:aqM4txdIMrBVupbnaS-Z8XFUWE@ec2-54-204-15-248.compute-1.amazonaws.com:5432/dasqm125it10r1

but then when I try something like

heroku pg:reset postgres://yyxuzvlrgcccgx:aqM4txdIMrBVupbnaS-Z8XFUWE@ec2-54-204-15-248.compute-1.amazonaws.com:5432/dasqm125it10r1

I get

!    Unknown database: dasqm125it10r1. Valid options are: DATABASE_URL. 

Why's that?

Simone Carletti
  • 173,507
  • 49
  • 363
  • 364
emi
  • 2,830
  • 5
  • 31
  • 53
  • This should help http://someguyonrails.tumblr.com/post/34541604299/resetting-your-production-database-on-heroku – Prakash Murthy Jun 16 '15 at 18:01
  • Can you try to rephrase your question, what are you trying to do? If you have the remote set up in your local git repo you do not need to specify the database url when running `heroku pg:reset` – max Jun 16 '15 at 18:02
  • i have a db with some test data inside that i want to get rid of. @maxcal :) i tried running `heroku pg:reset` alone but it's asking for `DATABASE_URL` – emi Jun 16 '15 at 18:07

1 Answers1

1

You need to base the database URL to the heroku command or heroku doesnt know which database you are referring to.

Doing heroku pg:info if give you information about the database URL, which will look something like === HEROKU_POSTGRESQL_MAROON_URL (DATABASE_URL)

Check out the heroku docs:https://devcenter.heroku.com/articles/heroku-postgresql

ChrisBarthol
  • 4,871
  • 2
  • 21
  • 24
  • lol. that command doesn't give me that output in the list of results. – emi Jun 16 '15 at 18:27
  • Yes it does, there are three equal signs (===) and then your database URL. If it doesn't please post what it is giving you. – ChrisBarthol Jun 16 '15 at 18:29
  • 1
    I think DATABASE_URL is actually the argument. i thought it was a placeholder. got it fixed now. thanks. – emi Jun 16 '15 at 18:31