{"id":1075,"date":"2022-08-30T15:11:58","date_gmt":"2022-08-30T15:11:58","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/09\/heroku-wont-reset-my-database-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:11:58","modified_gmt":"2022-08-30T15:11:58","slug":"heroku-wont-reset-my-database-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/heroku-wont-reset-my-database-collection-of-common-programming-errors\/","title":{"rendered":"Heroku won&#39;t reset my database-Collection of common programming errors"},"content":{"rendered":"<p>I have been trying to run <strong>$ heroku pg:reset<\/strong> from the command line but I believe I&#8217;m not putting in the database correctly. I&#8217;ve tried a number of variations.<\/p>\n<p>I ran <strong>$ heroku config | grep POSTGRESQL<\/strong> to get the database name which prints as<\/p>\n<p>HEROKU_POSTGRESQL_PINK_URL: postgres:\/\/naknaswvxfvuup:QK2dHYNMZ_va10lDgMDo4S0BIM@ec2-23-21-161-255.compute-1.amazonaws.com:5432\/db7eute4gu4mcb<\/p>\n<p>I&#8217;ve tried running everything from<\/p>\n<p><strong>#1<\/strong> $ heroku pg:reset HEROKU_POSTGRESQL_PINK_URL: postgres:\/\/naknaswvxfvuup:QK2dHYNMZ_va10lDgMDo4S0BIM@ec2-23-21-161-255.compute-1.amazonaws.com:5432\/db7eute4gu4mcb<\/p>\n<p><strong>#2<\/strong> $ heroku pg reset postgres:\/\/naknaswvxfvuup:QK2dHYNMZ_va10lDgMDo4S0BIM@ec2-23-21-161-255.compute-1.amazonaws.com:5432\/db7eute4gu4mcb<\/p>\n<p><strong>#3<\/strong> $ heroku pg:reset db7eute4gu4mcb<\/p>\n<p>and other variations. Please let me know how to correctly note this as I keep getting either an error or this text from the commmand line &#8221; ! Unknown database: db7eute4gu4mcb. Valid options are: DATABASE_URL, HEROKU_POSTGRESQL_PINK_URL&#8221;<\/p>\n<p>I&#8217;m currently at 10.4 on the Ruby on Rails tutorial. Thanks!<\/p>\n<ol>\n<li>\n<p>You should specify a DATABASE when run <code>heroku pg:reset<\/code>. This is the syntax:<\/p>\n<pre><code>heroku pg:reset \n<\/code><\/pre>\n<p>To know the value of , you can run:<\/p>\n<pre><code>heroku pg:info\n<\/code><\/pre>\n<p>It will return DATABASE_URL, something like: <strong>HEROKU_POSTGRESQL_GRAY_URL<\/strong><br \/>\nThen you can reset your database:<\/p>\n<pre><code>heroku pg:reset HEROKU_POSTGRESQL_GRAY_URL\n<\/code><\/pre>\n<p>In your case, to reset database run:<\/p>\n<pre><code>heroku pg:reset HEROKU_POSTGRESQL_PINK_URL\n<\/code><\/pre>\n<\/li>\n<li>\n<p>Assuming you have your authentication information exported to the shell environment, you should be fine with just passing the name of the database. For example:<\/p>\n<pre><code>PGPASSWORD='foobarbaz'\nexport PGPASSWORD\nheroku pg:reset pink\n<\/code><\/pre>\n<p>There are certainly other ways to use the reset command, but IMHO this is the easiest.<\/p>\n<\/li>\n<\/ol>\n<p id=\"rop\"><small>Originally posted 2013-11-09 23:21:33. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>I have been trying to run $ heroku pg:reset from the command line but I believe I&#8217;m not putting in the database correctly. I&#8217;ve tried a number of variations. I ran $ heroku config | grep POSTGRESQL to get the database name which prints as HEROKU_POSTGRESQL_PINK_URL: postgres:\/\/naknaswvxfvuup:QK2dHYNMZ_va10lDgMDo4S0BIM@ec2-23-21-161-255.compute-1.amazonaws.com:5432\/db7eute4gu4mcb I&#8217;ve tried running everything from #1 $ heroku [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1075","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1075","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=1075"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1075\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=1075"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=1075"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=1075"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}