How to Connect Your Heroku PostgreSQL Database to Indiequery

Last updated: November 21, 2025

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:

  1. Host - Enter the hostname from your Heroku credentials
  2. Port - Enter the port (usually 5432)
  3. Database - Enter the database name
  4. Username - Enter the username
  5. Password - Enter the password
  6. Keep "Require SSL" checked (Heroku requires SSL)
  7. Name your connection (e.g., "Heroku Production")
  8. 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.