Managed Postgres options for teams leaving Heroku Postgres, how they compare on price, networking, extensions and migration effort, and how to run Postgres on RDS or Cloud SQL in your own cloud account.

Heroku Postgres is the add-on most Heroku apps start with, and its model is simple: attach a plan, read DATABASE_URL, and let Heroku handle backups, failover and version upgrades. It starts to cost more than it should when a database outgrows the $5 to $20 Essential plans and the next step is $50 a month for Standard-0, when the app moves to AWS or GCP and the database is still across the internet on Heroku, or when the platform itself stops getting new features.
This guide compares managed Postgres options for teams leaving Heroku Postgres, on price, networking, extensions and how much the move takes, and shows how Encore runs Postgres on RDS or Cloud SQL in your own cloud account from a database declared in Go.
Heroku prices are from the Heroku Postgres add-on page, checked November 17, 2026: Essential-0, 1 and 2 cost $5, $9 and $20 a month for 1, 10 and 32 GB of storage on shared hardware, Standard-0 is $50 for 4 GB of RAM, 64 GB of storage and 200 connections, Premium-0 with high availability is $200, and the newer Advanced tier bills per instance pool with 100 GB of storage included and $0.20 per GB after that.
Encore brings infrastructure from code to Go and TypeScript backends, and for a Heroku app the add-on and its DATABASE_URL turn into one declaration in the service that uses the database. encore run starts Postgres locally and applies the migrations, and each AWS or GCP environment gets RDS for PostgreSQL or Cloud SQL in your own account, in private subnets with automated daily backups kept for seven days, as the AWS and GCP infrastructure docs describe.
Run in your terminal to get started locally.
A common job for a Heroku Postgres database is recording usage that a client may send twice, so the schema makes the event ID the primary key:
-- usage/migrations/1_create_usage.up.sql
CREATE TABLE usage_events (
event_id TEXT PRIMARY KEY,
account_id BIGINT NOT NULL,
units INT NOT NULL CHECK (units > 0),
created_at TIMESTAMPTZ NOT NULL DEFAULT now()
);
CREATE INDEX usage_events_account_created ON usage_events (account_id, created_at);
The service records each event once and sums the month so far:
// usage/usage.go
package usage
import (
"context"
"time"
"encore.dev/beta/errs"
"encore.dev/storage/sqldb"
)
// Replaces the Heroku Postgres add-on and DATABASE_URL: RDS on AWS,
// Cloud SQL on GCP, started locally by `encore run`.
var db = sqldb.NewDatabase("usage", sqldb.DatabaseConfig{
Migrations: "./migrations",
})
type RecordParams struct {
EventID string `json:"event_id"`
AccountID int64 `json:"account_id"`
Units int `json:"units"`
}
type RecordResponse struct {
Recorded bool `json:"recorded"`
}
// Record stores a usage event once, so a client retry with the same
// event_id is not counted twice.
//
//encore:api public method=POST path=/usage
func Record(ctx context.Context, p *RecordParams) (*RecordResponse, error) {
if p.EventID == "" || p.AccountID <= 0 || p.Units <= 0 {
return nil, &errs.Error{Code: errs.InvalidArgument, Message: "event_id, account_id and positive units required"}
}
res, err := db.Exec(ctx, `
INSERT INTO usage_events (event_id, account_id, units)
VALUES ($1, $2, $3)
ON CONFLICT (event_id) DO NOTHING`,
p.EventID, p.AccountID, p.Units)
if err != nil {
return nil, err
}
return &RecordResponse{Recorded: res.RowsAffected() == 1}, nil
}
type Summary struct {
AccountID int64 `json:"account_id"`
Month string `json:"month"`
Units int64 `json:"units"`
}
// MonthToDate sums the account's usage since the start of the UTC month.
//
//encore:api public method=GET path=/usage/:accountID
func MonthToDate(ctx context.Context, accountID int64) (*Summary, error) {
s := &Summary{AccountID: accountID, Month: time.Now().UTC().Format("2006-01")}
err := db.QueryRow(ctx, `
SELECT COALESCE(SUM(units), 0)
FROM usage_events
WHERE account_id = $1
AND created_at >= date_trunc('month', now(), 'UTC')`,
accountID).Scan(&s.Units)
if err != nil {
return nil, err
}
return s, nil
}
The retried event is ignored, because ON CONFLICT DO NOTHING affects no row the second time, and the SQL in this sample was checked against Postgres 17, including the three-argument date_trunc that pins the month to UTC. Code that already takes a *sql.DB keeps working when you pass it db.Stdlib(), and encore db shell usage --env=prod takes the place of heroku pg:psql, with read-only access unless you add --write, as the database docs explain.
Moving the data itself is a pg_dump from Heroku and a restore into the new database, which the step-by-step guides for RDS and Cloud SQL walk through, including the heroku_ext extension schema that trips up many restores. If you would rather keep an RDS instance you created yourself, Encore can use an existing RDS database instead of provisioning one. An AI coding agent adding a column later writes 2_add_source.up.sql and the code that uses it in the same change and tests both against the local database, and the next deploy applies the migration in every environment.
Best fit: Go or TypeScript apps leaving Heroku for AWS or GCP that want Postgres on the private network next to the services, declared in code and running locally with encore run.
RDS is where most Heroku Postgres databases go when the app moves to AWS. You pick the instance class and storage, turn on Multi-AZ for a standby in a second availability zone, and get automated backups with point-in-time restore for up to 35 days, according to the RDS backup documentation. Followers map onto read replicas, forks onto a snapshot restore, and Dataclips onto a read-only replica you point a BI tool at.
What Heroku handled for you becomes yours to set up: the VPC and subnets, a security group that lets only the app in, the parameter group, major version upgrades and credentials in Secrets Manager. RDS also gives you things Heroku does not, such as access to rds_superuser-level roles, a much longer list of extensions and instance sizes far beyond Heroku's largest plans.
Best fit: apps moving to AWS that want the database in the same VPC and have someone to own its networking and upgrades.
Cloud SQL for PostgreSQL is the GCP counterpart, with regional high availability, read replicas, point-in-time recovery and clones that cover what forks did on Heroku. Cloud Run connects through the Cloud SQL connector or over private IP, and pricing follows the vCPUs and memory you provision, plus storage.
Cloud SQL has no true superuser, so a few extensions and COMMENT ON EXTENSION statements from a Heroku dump need attention during the restore, and the supported extension list is worth checking against pg_extension on the Heroku side before you start.
Best fit: apps moving to Cloud Run or GKE that want Postgres in the same Google Cloud project.
Neon runs Postgres with storage separated from compute, so idle databases scale to zero and branches are copy-on-write copies of another branch, which makes it the closest match to Heroku's forks for testing against production-shaped data. Its pricing page, checked November 17, 2026, lists a Free plan with 100 projects and 100 CU-hours each, a Launch plan at $0.106 per CU-hour plus $0.35 per GB-month, and a Scale plan at $0.222 per CU-hour with private networking.
The first query after a database scales to zero waits for compute to start, which matters for always-on APIs, and Neon is now part of Databricks.
Best fit: small or low-traffic databases and teams that want a database branch for every pull request.
Supabase gives every project a dedicated Postgres instance along with auth, storage, realtime and a generated REST API. The Pro plan is $25 a month with $10 of compute credits that cover one Micro instance with 1 GB of RAM, and larger instances are priced per size, according to its pricing page checked November 17, 2026.
For a Heroku app that only needs the database, those extras go unused, though they can replace a separate auth add-on if the app has one.
Best fit: apps that want Postgres together with auth and file storage from one provider.
Render is the closest PaaS to Heroku in day-to-day use, and Render Postgres pairs with its web services and workers on the same private network. Its pricing page, checked November 17, 2026, lists free instances with usage limits, paid instances priced by compute up to 128 CPUs and 1,024 GB of RAM, expandable storage at $0.30 per GB, connection pooling and point-in-time recovery, with read replicas and high availability on paid instances.
Moving from Heroku Postgres to Render Postgres is the smallest change of the options here when the app moves to Render as well, though the database still runs on the provider's infrastructure rather than in your cloud account.
Best fit: teams moving the whole app from Heroku to Render.
Stay on Heroku Postgres if the app stays on Heroku and the plan you are on fits the data. Pick RDS or Cloud SQL when the app is moving to AWS or GCP and the database should sit on the same private network, and Render Postgres when the app is moving to Render. Pick Neon or Supabase for small databases that benefit from a free tier, branching or built-in auth. Pick Encore when you want RDS or Cloud SQL in your own account with the database, its migrations and the services that use it declared in Go or TypeScript and running locally with encore run, so the migration off Heroku also leaves you with a database setup you can recreate in any environment.
For teams moving the app to AWS or GCP, the usual choice is managed Postgres in the same account: Amazon RDS for PostgreSQL on AWS or Cloud SQL on GCP, which keeps the database on the private network next to the app. Render Postgres suits teams moving to another PaaS, and Neon or Supabase suit small databases that benefit from a free tier or branching.
Heroku moved into sustaining engineering in February 2026, with no new features planned, and its first dedicated Postgres plan, Standard-0, costs $50 a month for 4 GB of RAM and 64 GB of storage. Teams moving their compute to AWS or GCP also want the database in the same network rather than reached across the internet.
On RDS and Cloud SQL, followers become read replicas and forks become a restore from a snapshot or a point-in-time recovery into a new instance. Neon branches are the closest match to forks, since a branch is a copy-on-write copy that is ready in seconds.
With Encore you declare the database in Go with sqldb.NewDatabase("usage", sqldb.DatabaseConfig{Migrations: "./migrations"}) and query it with db.Exec and db.QueryRow, and existing database/sql code can take db.Stdlib(). encore run starts Postgres locally, and on deploy Encore provisions RDS on AWS or Cloud SQL on GCP in your account and supplies the connection, so there is no DATABASE_URL to set.
Deploy to your cloud on AWS and Google Cloud
without managing infrastructure
Encore lets developers and agents define application infrastructure directly in code, then automatically provisions it from local development to production in your AWS or GCP account.