← Blog · Guides

Can You Get Your Data Out? Replication Moves Rows, Not Your Schema or Sequences

December 1, 2026

"Can I get my data out?" is the wrong question to ask a managed database, because the answer is almost always yes. The useful question is what the exit carries with it.

On 1 December 2026 Heroku published Introducing Managed Logical Replication Support for Heroku Postgres Advanced. It opens: "Logical replication is now available for all Heroku Postgres Advanced databases." The post is about one tier, Postgres Advanced, not every Heroku Postgres plan. We wrote about that tier's launch in Heroku Postgres Advanced is GA: the announcement names no price; this article is about capability, not cost.

What makes the post worth reading, as of 2 December 2026, is how plainly it states the limits. In Heroku's words: "Logical replication sends row changes; it does not copy DDL or sequence state." Heroku describes this as "standard Postgres behavior", so it is not presented as a Heroku shortcoming. It is the part of a migration plan that people leave out.

What Heroku says the feature carries

Heroku says the feature answers a customer request: "You asked for a way to keep databases in sync during a version upgrade or migration." A Postgres Advanced database can be a publisher, sending row changes to another database, or a subscriber, receiving them from another Postgres publisher.

Three things in the post do not travel with those rows. All three are Heroku's statements about Heroku's product.

  • Table definitions. "The subscriber database needs matching schemas and tables before it receives changes." The target has to be built before replication starts.
  • Later schema changes. The post says logical replication does not replicate CREATE, ALTER, or DROP statements, and tells readers: "Repeat schema changes on each subscriber."
  • Sequence counters. "Set sequence values on the target as part of a migration or cutover plan. Sequence state is not replicated."

So the rows arrive. The tables they land in, the changes you make to those tables along the way, and the counters that hand out the next ID are yours to move.

What the post does not say

The post tells you to repeat schema changes on each subscriber. It does not say what happens to a running subscription if you change the publisher's schema and do not. We will not guess. It points to a logical replication guide for prerequisites and operational guidance, and that is the place to look before you rely on the answer.

The checklist: what does your exit carry?

These questions apply to whatever managed Postgres you are on today. Ask them on a quiet day, of your provider's documentation and of your own plan.

1. Who creates the schema on the target, and from what?

If replication does not carry table definitions, something else must. Decide whether that is a schema-only dump from the source or your application's migrations run against the empty target, then check that the two databases match before any rows move.

pg_dump --schema-only --no-owner "$SOURCE_URL" > schema.sql
psql "$TARGET_URL" -f schema.sql

2. What is your rule for schema changes while replication runs?

A sync that runs for days will meet a deploy that adds a column. Pick a rule in advance: freeze schema changes until cutover, or apply every change to both sides in a fixed order. Write the rule down where the person deploying will see it.

3. What will your sequences be set to at cutover?

This is the one that hurts at 3am. If the counters are not moved, the first insert on the new database can ask for an ID that a replicated row already holds, and fail. List every sequence, not only the ones you remember:

SELECT schemaname, sequencename, last_value
FROM pg_sequences
ORDER BY 1, 2;

Then, at cutover, set each one on the target from the table it feeds. Only ever move a counter forward:

SELECT setval('orders_id_seq',
              GREATEST((SELECT COALESCE(MAX(id), 1) FROM orders),
                       (SELECT last_value FROM orders_id_seq)));

Run the list again on the target afterwards and compare it with the source.

4. Does every table have a primary key?

Heroku's list includes this: "Ensure published tables have a primary key or suitable replica identity if you replicate updates or deletes." Find the tables that have none before you start, not when an update fails to arrive.

5. Who holds the credential that does the replicating?

On Heroku's description, "Enabling publishing creates a separate publisher credential with only the privileges needed for replication." Ask the same of your own setup: is replication running on a dedicated, limited credential, or on the owner's password pasted into another system? And who removes it after cutover?

6. Do you run the SQL, or does the provider's tooling?

Heroku says: "The CLI manages publications instead of asking you to run CREATE PUBLICATION directly." That is a reasonable design for a managed service, and it also means a runbook written for plain Postgres will not apply line for line. Rehearse with the provider's actual commands.

7. What happens on the source if the target goes away?

Heroku warns: "A disconnected subscriber can cause the publisher to retain WAL until the subscriber reconnects or you remove the slot." A sync you set up and forgot can become a disk problem on the database you were trying to leave. Decide who watches the replication slot, and who removes it if the migration is abandoned.

8. Have you rehearsed the cutover itself?

Do it once on a copy: stop writes, wait for the target to catch up, set the sequences, point the application at the target, insert one row in every table that has a counter. The insert is the test. A row count that matches proves the rows arrived; it does not prove the next one can be written.

The short version

"Replication is supported" and "your database will arrive" are different sentences. On Heroku's own account of its own feature, the rows travel and the definitions and counters do not. Whatever provider you use, find the equivalent sentence in their documentation, and plan for the parts that are yours to carry.

Source, read 2 December 2026: Heroku, "Introducing Managed Logical Replication Support for Heroku Postgres Advanced" by Justin Downing (published 1 December 2026). The quoted sentences are Heroku's description of its own product; the SQL examples are ours and are general Postgres commands to adapt, not Heroku's instructions.