How do I connect my PostgreSQL Database to Indiequery?

Last updated: November 21, 2025

Connecting your PostgreSQL database to Indiequery takes about 5 minutes. You'll need your database host, port (usually 5432), database name, username, and password. Indiequery automatically tests the connection and creates a project for you when you're done.

Want to try Indiequery first? Use our demo PostgreSQL database to explore the product before connecting your own database.

What You Need to Connect

Grab these connection details from your database provider:

  • Host: Your server address (like db.example.com)
  • Port: Usually 5432 for PostgreSQL
  • Database name: The specific database you want to query
  • Username: Your database user
  • Password: User password Most cloud providers (Supabase, Neon, Railway, Render) show these in a "Connection Details" or "Database" section of their dashboard.

Connect Your Database in 3 Steps

1. Go to app.indiequery.com and click "Add Database Connection"

2. Fill in the connection form:

  • Connection Name: Pick a friendly name like "Production DB" or "Analytics" - this is how you'll identify your database in Indiequery
  • Database Type: Select PostgreSQL (we also support MySQL)
  • Host: Your database server address
  • Port: 5432 (PostgreSQL default)
  • Database Name: The database you want to query
  • Username: Your PostgreSQL user
  • Password: User password
  • Require SSL: Keep this checked (recommended for security) 3. Click "Add Connection"

Indiequery automatically tests your connection when you click Add Connection. If the test succeeds, you'll see a success message. If it fails, you'll see the specific error - jump to the troubleshooting section below for fixes.

Try the Demo Database First

Not ready to connect your own database yet? Click "Try Demo Database" on the connections page to explore Indiequery with sample data. The demo database includes a few tables with realistic data so you can test queries, visualizations, and dashboards without any setup.

For security, create a dedicated read-only user for Indiequery. This prevents accidental data changes.

-- Create a read-only user for Indiequery
CREATE USER indiequery_readonly WITH PASSWORD 'secure_password';

-- Grant connection and schema access
GRANT CONNECT ON DATABASE your_database TO indiequery_readonly;
GRANT USAGE ON SCHEMA public TO indiequery_readonly;

-- Grant select on all tables
GRANT SELECT ON ALL TABLES IN SCHEMA public TO indiequery_readonly;

-- Grant select on future tables (optional)
ALTER DEFAULT PRIVILEGES IN SCHEMA public
GRANT SELECT ON TABLES TO indiequery_readonly;

Replace your_database with your actual database name and use a strong password. Then use these credentials in Indiequery instead of your admin user.

Note: Indiequery sets all connections to read-only mode automatically at the session level, but creating a dedicated read-only user adds an extra layer of protection.

Whitelist Indiequery's IP Address

If your database requires IP whitelisting, add Indiequery's server IP: 91.98.141.61

For cloud databases:

  • Add 91.98.141.61 to your allowed IP addresses or security groups
  • Look for "Networking" or "Security" sections in your provider's dashboard
  • Make sure connections are allowed on port 5432 (or your custom port) For self-hosted PostgreSQL: Edit pg_hba.conf to allow connections from Indiequery:
host    your_database    your_user    91.98.141.61/32    md5

Restart PostgreSQL after making changes.

Fix Common Connection Issues

"Connection failed" or "Connection timed out"

This usually means a firewall is blocking the connection.

  • Whitelist our IP (91.98.141.61) in your firewall or security groups
  • Verify your database accepts external connections
  • Double-check the host and port are correct
  • Make sure port 5432 is open Indiequery has a 30-second connection timeout. If your database takes longer to respond, the connection will fail.

"SSL connection required" error

Your database requires SSL but it's not enabled. Check the "Require SSL connection" box in Indiequery's connection settings.

If the error persists, your PostgreSQL server might not be configured for SSL. Contact your database provider or check your postgresql.conf file.

"Authentication failed" or "Permission denied"

Your username/password is wrong, or the user lacks permissions.

  • Verify username and password are correct (try copy-pasting to avoid typos)
  • Ensure the user has CONNECT privilege on the database
  • Check the user has USAGE privilege on the schema (usually 'public')
  • Verify the user has SELECT privilege on tables you want to query "Database does not exist"

The database name is misspelled or doesn't exist on the server.

  • Check the database name spelling (PostgreSQL is case-sensitive)
  • Make sure you're connecting to the right server Can't see tables in the schema browser

Indiequery only shows tables your user can access. Grant SELECT permissions:

-- See what tables your user can access
SELECT * FROM information_schema.table_privileges
WHERE grantee = 'your_username';

-- Grant access if needed
GRANT SELECT ON ALL TABLES IN SCHEMA public TO your_username;

What Happens After You Connect

Once your connection is set up:

  1. Connection test runs automatically - Indiequery verifies it can reach your database
  2. Schema browser loads - View all your tables, columns, and data types
  3. You're ready to query - Navigate to the query editor and start writing SQL Use the "Test Connection" button on the connections page to re-test an existing connection anytime.

How Indiequery Keeps Your Data Secure

  • Encrypted storage: All connection credentials are encrypted
  • SSL/TLS required: All database connections use encrypted transport
  • Read-only by default: Indiequery cannot modify your data
  • No data retention: Query results are automatically deleted after 7 days We recommend using SSL connections and read-only database users for all production databases.