# Subscribing Neon to an external publisher

## The trap
Direction confusion: "enable logical replication" must happen where the data comes from. Replicating into Neon means the source (RDS, self-hosted Postgres, etc.) needs `wal_level = logical` and a restart, not your Neon project.

## The rule
1. On the source database: set `wal_level = logical`, restart, create the publication and replication slot.
2. In Neon: create the subscription pointing at the source with the direct connection details.
3. The replication connection originates from Neon toward the source; the source's firewall and `pg_hba` must allow it.
4. Initial sync copies existing data, then streams changes; large tables take a while and the subscriber lags during catch-up.

## Checklist
- wal_level on the source, not on Neon, when replicating in.
- Source needs a role with replication privilege for the subscription connection.
- Schema changes on the publisher need handling; logical replication does not replicate DDL.
- This is the core mechanic of zero-downtime migrations onto Neon: replicate, verify, cut over.