Heroku Postgres logo

Managed Postgres speaks PostgreSQL

Connect Heroku Postgres to Excel, Sheets and AI

Heroku Postgres from your DATABASE_URL. Heroku databases sit on bare EC2 hostnames, so the card is how the connection knows it is Heroku.

1connection
0inbound ports
read-onlyenforced

One connection, every surface

Where your Heroku data can go

Connect Heroku once and the same read-only connection feeds all of these — no second setup, no second copy of the data. 9 of 11 have a step-by-step guide.

Guide

Heroku to Excel

Microsoft Excel · Excel add-in

Pull live Heroku results straight into a worksheet and refresh them on demand — desktop Excel, Excel Online, Microsoft 365.

Read the PostgreSQL guide
Guide

Heroku to Google Sheets

Sheets add-on

Run a saved Heroku query from the sidebar and drop the rows into the sheet. Shared collaborators can refresh it themselves.

Read the PostgreSQL guide
Guide

Heroku MCP server

Claude, Cursor and MCP clients

Give an AI assistant read-only access to Heroku with the schema it needs to write correct SQL — no credentials in the chat.

Read the PostgreSQL guide
Guide

Heroku REST API

HTTP endpoint

Publish a Heroku query as an authenticated JSON endpoint any application can call, with an OpenAPI 3.1 spec and ready-made Postman, Insomnia and Hoppscotch collections. No database port is opened.

Read the PostgreSQL guide
Guide

Heroku to Airtable

Automation platform

Sync Heroku rows into an Airtable base on a schedule, or fetch them inside an Airtable automation script.

Read the PostgreSQL guide
Guide

Heroku to Baserow

Automation platform

Feed a Baserow table from Heroku over the REST endpoint — self-hosted or Baserow cloud.

Read the PostgreSQL guide
Guide

Heroku to SeaTable

Automation platform

Keep a SeaTable base current with Heroku data without exporting a file or exposing the database.

Read the PostgreSQL guide
Guide

Heroku to Smartsheet

Automation platform

Push Heroku results into a Smartsheet grid so plans and reports read from the source system, not last week's export.

Read the PostgreSQL guide
Guide

Heroku to Anvil

Anvil Works · App platform

Back an Anvil Python app with Heroku through the REST endpoint instead of embedding database credentials in the app.

Read the PostgreSQL guide
Supported

Heroku to Power BI

Power Query M

Paste the generated Power Query M into the Power BI Advanced Editor and the report reads live Heroku results over HTTPS — no ODBC driver, no database port opened.

How Power BI works no Heroku walkthrough written yet
Supported

Heroku alerts and reports

Slack · Discord · Email · Webhook

Put a Heroku query on a schedule and have the rows delivered to Slack, Discord, email or a signed webhook — or hold the message until a row count, threshold or percentage change crosses the line you set.

How alerts and reports work no Heroku walkthrough written yet

How it works

5 steps, no inbound firewall change

01

Install the Network Agent wherever suits you. It opens one outbound connection and never listens, so Heroku sees an ordinary client and your network needs no inbound rule.

02

Copy DATABASE_URL from the app's Settings then Config Vars, and paste it into the first field. Host, port, database, username and password are all read out of it.

03

Leave Use SSL on before you run the test. Heroku expects an encrypted connection, and on a brand-new connection that checkbox is what provides it.

04

Save. The Heroku badge is written at that moment, which is what keeps the connection recognisable afterwards.

05

Come back and re-paste after a Heroku credential rotation. Microsoft Excel, Google Sheets, Power BI, MCP and REST all read through that one connection in the meantime.

Feature deep-dive

What Heroku gives you

Nothing about the hostname says Heroku

Every other managed Postgres card here can recognise its own service by the address. This one cannot, and the difference is worth understanding.

  • Heroku Postgres answers on bare EC2 names in the shape ec2-12-34-56-78.compute-1.amazonaws.com. There is no heroku in the hostname to match on.
  • So the provider identity is recorded when you save from this card, rather than inferred from where you connected. That is what drives the badge and the icon afterwards.
  • The practical consequence: a plain PostgreSQL connection you made earlier to a Heroku database will not pick up Heroku branding retroactively. Cards like Neon and Koyeb do exactly that from their hostnames — Heroku is the case where it cannot work.
  • If you want the branding on an older connection, remake it from this card. Nothing about the data path changes; it is a labelling difference.

Self-signed certificates, and what encrypted means here

Heroku fronts its databases with its own certificates, which shapes what the agent can sensibly check.

  • Use SSL is on by default and the connection is encrypted. The agent requires TLS rather than merely offering it.
  • The certificate chain is not verified. Heroku's certificates are self-signed, so full verification would reject a perfectly correct connection — requiring encryption without validating the chain is the setting that matches the service.
  • Read that as protection against anyone reading the traffic, not as proof of what you reached. It is the same posture the Railway card takes, and for the same reason.
  • Leave the checkbox alone before your first test. On a connection that has not been saved yet, that checkbox is the only thing turning encryption on.

Rotation is a thing you will meet

Heroku changes database credentials during maintenance, and the agent stores what you gave it.

  • When Heroku rotates, DATABASE_URL changes and the stored credentials stop working. The card says so on the way in rather than leaving you to discover it.
  • Fixing it is re-pasting the current DATABASE_URL over the old one. Everything downstream — saved queries, schedules, shares — keeps working, because they point at the connection rather than at the credentials.
  • There is no automatic sync. Query Streams does not read your Heroku config vars, so the re-paste is a manual step and worth knowing about before it surprises you.
  • The pasted string itself is never stored. It is read once to fill the form and then dropped, so the password lives in one place rather than two.
-- Ordinary Postgres, read-only, over TLS
SELECT   c.name,
         COUNT(o.id)   AS orders,
         SUM(o.amount) AS revenue
FROM     public.customers AS c
JOIN     public.orders    AS o ON o.customer_id = c.id
WHERE    o.placed_at >= now() - interval '30 days'
GROUP BY c.name
ORDER BY revenue DESC;

Shared by every database connector

True of every database connector

  • Outbound only — the agent opens one encrypted connection out to Query Streams. No inbound port to forward, no VPN, no IP allowlist, nothing about your database exposed to the internet.
  • Credentials stay put — the database username and password live on the machine you installed the agent on. Query Streams never receives them and cannot reach your database on its own.
  • Read-only, enforced — one statement at a time, SELECT and friends only. A write is rejected on your own machine before it is ever sent to the server, rather than relying on a permission somebody remembered to set.
  • Deploy as many agents as you like — one per site, region or cloud. Every data source they can see arrives in a single dropdown, so nobody has to know which agent hosts what.

What you get once a query is saved

  • Share the capability, not the SQL — a colleague or an outside partner can run your query and change its filters without ever seeing the statement behind it.
  • Filters from either direction — declare them yourself as @variables, or let the connector spot the literal values already sitting in your WHERE clause and offer those as dropdowns.
  • Read it from anywhere — Microsoft Excel, Google Sheets, Power BI, the REST API, AI assistants over MCP, the Query Builder and Nova all read the same saved query.
  • Run several at once — five saved queries into five worksheet tabs, streamed concurrently, however large the results.
  • Join it to anything else you have connected — another database, a business API, or a folder of files, in one read-only statement.

Cross-source SQL

Join Heroku to the rest of your data

One statement can span Heroku and your other connections at once. Each source runs only the part it can, streams the result back, and the join happens centrally — the sources never talk to each other and nothing is copied anywhere.

3 connections · 3 agents

Heroku Postgres Managed Postgres
Microsoft SQL Server Relational engine
Stripe Payments & billing

One statement

-- nothing copied, nothing merged, nothing scheduled
SELECT   c.region, COUNT(*) AS orders, SUM(i.amount_due) AS invoiced
FROM     heroku_app.public.orders1 f
JOIN     erp_sql.dbo.customers2    c ON c.id = f.customer_id
JOIN     billing.stripe.invoices3  i ON i.customer = c.stripe_id
GROUP BY c.region
ORDER BY invoiced DESC;

The three parts are connection, schema and table — and the connection name is whatever you called it. Illustrative columns; your tables will be your tables. Read-only applies to every piece: SELECT, WITH and EXPLAIN only, with a ceiling on how much any one source may hand over for a single query. How federated queries work

Connection details

What Heroku needs

Host
A bare EC2 name such as ec2-12-34-56-78.compute-1.amazonaws.com — nothing in it identifies Heroku
Port
5432
Driver
Npgsql, carried by the agent — nothing to install at the Heroku end
Paste format
DATABASE_URL from Settings then Config Vars, as a postgres:// URI
TLS
Required. Encrypted; the certificate chain is not verified, which is what Heroku's self-signed certificates need
Pooling
None. The agent applies no pooler adaptations for Heroku
Credentials
Rotated by Heroku during maintenance. Re-paste the current DATABASE_URL when that happens — there is no automatic sync
Saved as
PostgreSQL, with Heroku kept as a badge. Because the hostname is anonymous, that badge only exists if you saved from this card
Default schema
public, which is what a federated reference carries

Heroku is the preset that makes the underlying design visible. Every card here saves as its real engine and keeps the provider as a label, and for most of them the label is belt and braces — the hostname would have given it away anyway. Heroku has no such fallback, so the label is the only record. That is why remaking an old connection through this card is the fix for missing branding, and why there is no way to make it happen retroactively.

The rotation warning is the most practically useful thing on the card. Heroku rotating credentials during maintenance is normal operation, not a fault, and the failure it produces is an authentication error that looks exactly like someone having changed a password. Knowing in advance that re-pasting DATABASE_URL is the whole fix turns a confusing outage into a thirty-second task.

For a cross-source query Heroku is ordinary Postgres. A connection you called heroku_app is written heroku_app.public.orders, and it joins to a folder of CSVs, an on-premises system of record or a billing API in one read-only statement — with nothing copied and nothing scheduled.

Vendor documentation: www.heroku.com

FAQ

Questions about Heroku Postgres

Which tools can read Heroku Postgres data through Query Streams?

All of them, from one connection: Excel, Google Sheets, MCP, REST API, Airtable, Baserow, SeaTable, Smartsheet, Anvil, Power BI, scheduled alerts and reports. Connect the database once and every surface reads the same read-only connection — there is no per-tool setup and no second copy of the data.

Do I have to open a firewall port to my Heroku Postgres database?

No. The Query Streams Network Agent runs inside your network and opens a single outbound encrypted connection. Nothing listens for inbound traffic, no VPN is required, and the database keeps its existing firewall rules.

Can Query Streams change data in Heroku Postgres?

No. The agent enforces read-only at the point of execution — one statement at a time, SELECT and friends only. Credentials stay on the agent and are never sent to Query Streams.

What does Query Streams need to connect to Heroku Postgres?

A reachable host, a role and its password — the agent carries the driver, so nothing is installed on the database. Host: A bare EC2 name such as ec2-12-34-56-78.compute-1.amazonaws.com — nothing in it identifies Heroku. Port: 5432. Driver: Npgsql, carried by the agent — nothing to install at the Heroku end. Paste format: DATABASE_URL from Settings then Config Vars, as a postgres:// URI.

Can I join Heroku Postgres to another database in the same query?

Yes — that is a federated query. One statement can reference Heroku Postgres and your other connections at once, written as connection.schema.table. Each source runs only the part it can and streams the result back; the join happens centrally, so the sources never connect to each other and nothing is copied or scheduled. Read-only applies to every piece — SELECT, WITH and EXPLAIN only — and there is a ceiling on how much any one source may hand over for a single query. Federated queries are a plan feature; the federated queries page carries the current source and size limits.

Is connecting Heroku Postgres different from connecting PostgreSQL?

Only the connection string. Heroku Postgres speaks the PostgreSQL wire protocol, so filters, scheduling, sharing, the Excel and Google Sheets add-ons and the MCP server all behave identically. The Heroku card pre-fills the host, port and SSL settings that provider expects.

Is there a Heroku to Excel guide?

Yes — it is the PostgreSQL guide, and it is correct for Heroku Postgres as written. Heroku speaks the PostgreSQL wire protocol, so Heroku to Excel, Heroku to Google Sheets and every other destination follow the same steps. The only Heroku-specific part is the connection string, and the Heroku card fills that in for you.

Put Heroku where the work happens

Install the agent, point it at your database, and pick a destination.

Read-only Outbound only Credentials stay on the agent