Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I view a PostgreSQL database on heroku with a GUI?

I have a rails app on heroku that is using a Postgre database. My database has > 40 tables and > 10,000 rows. I would like to delete a lot of data, but it would be much easier if I was able to view and interact with it in a GUI table. I can access my data in rails console, but it's taking too long.

like image 952
jlee Avatar asked Jul 25 '18 01:07

jlee


People also ask

How do I view PostgreSQL on heroku?

All Heroku Postgres databases have a corresponding Heroku application. You can find the application name on the database page at data.heroku.com. Your database is attached to the Heroku app and is accessible via an app config var containing the database URL, even if you host no code in the application itself.

How can I see my heroku database?

You can find them by visiting the Resources tab on your Dashboard then clicking on the DB you use. It will take you to the Addons page in another tab. Click on the Settings tab then View Credentials. Using these credentials, you can use Adminer to login to the DB.

How do I access PostgreSQL GUI?

To start pgAdmin, go to start menu and start pgAdmin. The server starts and displays the following window in browser. From the URL of the browser, we can learn that the server has provided us a Web Interface through the host 127.0. 0.1:50044.

Is there a GUI for PostgreSQL?

pgAdmin is the only PostgreSQL native GUI — plus, it's totally free and scales easily across multiple servers. pgAdmin makes for a great choice for Postgres-focused DBAs.


2 Answers

pgweb is a great cross-platform GUI, and it's easy to connect to your Heroku Postgres when launching from the command line.

I installed via Homebrew on a Mac (brew install pgweb), but instructions for other platforms are listed on the site. Here's how I launch pgweb connected to a Heroku Postgres DB:

heroku config:get DATABASE_URL | xargs pgweb --url

And if you want to connect to your localhost:

pgweb --host localhost

like image 100
Adam McCrea Avatar answered Sep 17 '22 19:09

Adam McCrea


I'm a little late here, but this may help someone else who stumbles across this thread...

If you go to your Heroku app's dashboard (through the website) > settings > "Reveal Config Vars" > DATABASE_URL, and 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 just 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 assume it will request to open any other SQL management app you might have.

like image 24
Mason Avatar answered Sep 18 '22 19:09

Mason