I have a little problem here, I have a django app, that, somehow, in production DB created a row in a table that doesn't exists, with the same name as other row that does exists, ok, this might sound strange, but my question in really simple:
I have a DB in heroku that I can't delete, and I want to delete a single row of a table, or even that table (and only that one), but I don't know how to do it.
How can I do it?
First, specify the table from which you want to delete data in the DELETE FROM clause. Second, specify which rows to delete by using the condition in the WHERE clause. The WHERE clause is optional. However, if you omit it, the DELETE statement will delete all rows in the table.
To delete a row, press the Delete toolbar button. A popup will open, asking you to confirm the deletion.
you can use the heroku cli with heroku pg:psql
to connect directly to your PG instance and then issue and SQL commands you want to. Alternatively use a GUI connected to the database (info in the DATABASE_URL config key from heroku config
) and do it from there.
I'm a little late here, but this might help someone who stumbles across this thread...
If you go to your Heroku app's dashboard (through the website) > settings > "Reveal Config Vars" > DATABASE_URL, and then paste that URL into the browser.
I use TablePlus for database management, when I paste the link into the browser it asks if it can open TablePlus and then I can edit my production database in real time like I would in development.
I'm not sure what pasting the URL into the browser will do if you don't have TablePlus. I imagine it will request to open any other SQL management app you might have.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With