How to Connect Your Heroku PostgreSQL Database to Indiequery
If you're running a PostgreSQL database on Heroku, you need a way to query and explore your data without installing desktop clients or using command-line tools. Indiequery connects to your Heroku PostgreSQL database in seconds and gives you a clean web interface for browsing tables and running queries. At $5/month, it's the cheapest and easiest option for exploring your Heroku database without complex setup.
Get Your Heroku Connection Details
Open your terminal and run this command to get your database credentials:
heroku pg:credentials:url -a your-app-name
This displays your connection details in a format like:
postgresql://username:password@host:port/database
You'll need to extract each component to connect to Indiequery:
- Host - The hostname between
@and:port - Port - The port number after the host (usually
5432) - Database - The database name at the end
- Username - The username after
:// - Password - The password between username and
@symbol
Connect to Indiequery
Go to app.indiequery.com and click Add Database Connection. Enter your connection details from the credentials output:
- Host - Enter the hostname from your Heroku credentials
- Port - Enter the port (usually
5432) - Database - Enter the database name
- Username - Enter the username
- Password - Enter the password
- Keep "Require SSL" checked (Heroku requires SSL)
- Name your connection (e.g., "Heroku Production")
- Click Add Connection Indiequery tests the connection automatically. If it succeeds, you can now browse your database schema, run SQL queries, and explore your data from any browser.
IP Whitelisting Not Available on Standard Plans
Heroku's common runtime PostgreSQL (Essential, Standard, Premium plans) doesn't support IP whitelisting. Your database is accessible from any IP address as long as you have valid credentials.
IP restrictions are only available on:
- Private and Shield Postgres plans with Mutual TLS (requires Private Spaces)
- Private Spaces with Trusted IP ranges feature For most Heroku users, database security relies on strong passwords (Heroku generates 65-character alphanumeric passwords automatically) and SSL connections. All Heroku Postgres connections require SSL by default.
Using Follower Databases for Safe Querying
If you're on a Standard plan or higher ($50/month minimum), you can create a follower database. Followers are read-only replicas that stay synced with your primary database.
Create a follower:
heroku addons:create heroku-postgresql:standard-0 --follow HEROKU_POSTGRESQL_PRIMARY_URL -a your-app
Wait for it to catch up:
heroku pg:wait
Get the follower's connection details:
heroku pg:credentials:url HEROKU_POSTGRESQL_FOLLOWER_COLOR
Use those credentials in Indiequery instead of your primary database. This keeps query load off your production database and prevents any accidental writes since followers are read-only.
Followers are not available on Essential (Hobby) tier plans.