External PostgreSQL subscriptions
Use PostgreSQL logical replication to receive one-way changes into an existing Briven project. The source remains primary. This capability does not switch your application connection, enable application Auth, or deploy functions.
Enable the capability
In your project dashboard, open Settings → Database → External PostgreSQL subscriptions. An owner or admin can enable subscription privileges for the main branch. The change grants the stable project owner membership in pg_create_subscription and CREATE on its own database, without superuser, role creation, or replication privileges. Older backends show unavailable.
The switch grants permission only. It does not create a source publication, subscription, replication slot, schema, or initial copy. A subscription owner must review those steps separately. Turning off the capability is refused while subscriptions exist. Removing a subscription can affect its source slot; follow a reviewed recovery procedure first.
Prepare the source and schema
Enable logical decoding on the source, choose an explicit publication and a dedicated source replication account, and review network access. Use a direct source connection with verified TLS and a suitable CA trust path on the target compute. Never use the pooled source endpoint. Keep source passwords private.
Retain the application’s existing migrations, types, enums, indexes, foreign keys, and triggers. Preview schema SQL before applying it. PostgreSQL subscriptions do not replicate DDL, sequences, views, large objects, or application job configuration. New tables require deliberate publication and subscription refresh, and a coordinated schema migration.
Native PostgreSQL subscriptions match schema and table names. They cannot rename a source vendor schema into a Briven schema. Do not create vendor-named Auth schemas on Briven to work around this limitation. An approved mapping and a separately validated CDC adapter are required for that data. Copying Auth records does not migrate sign-in or signing keys.
Check major-version compatibility first. A PostgreSQL 17 pg_dump cannot dump a PostgreSQL 18 source, and loading a newer dump into an older server needs independent schema verification.
Create a reviewed subscription
Connect with the project’s normal short-lived shell credential, preserving every DSN parameter including options and verifying TLS. Use a private direct SQL session and supply reviewed SQL through protected stdin or a private file. The Studio query endpoint audits SQL text; do not paste source connection passwords there, into chat, or into command arguments.
The stable project owner should own both subscription and target tables. Keep the default run_as_owner=false. The shell password expires and rotates; the role and background subscription persist. The apply worker uses the source connection stored privately in PostgreSQL’s subscription catalog, rather than the shell login password.
A native subscription with initial copy coordinates table snapshots with WAL catch-up. Do not label a multi-table mirror ready until all table synchronization states are ready and a source transaction watermark is verified at the target. A dump followed by an unrelated subscription can miss or duplicate changes.
Operate and recover
Enabled subscriptions keep the target compute awake, including while waiting to reconnect. Continuous source connections can also prevent source suspension and incur ongoing compute, WAL retention, and network costs. Monitor source slot health and retained WAL, target worker/table synchronization status, apply errors, and end-to-end transaction lag. Worker count alone does not confirm freshness.
Disconnection and a normal target restart resume from the retained replication position while the source slot remains valid. Rotate source credentials through a private reviewed ALTER SUBSCRIPTION connection change, reconnect the worker, and verify a new watermark. An invalidated or deleted source slot requires a reviewed consistent reseed; never silently skip missing WAL or drop an unrelated slot.
New child computes detach inherited subscriptions before workers are admitted, without deleting the parent’s source slots. A restored branch is an independent recovery target; it must not resume the parent’s consumer. Validate schema, rows, constraints, and a new snapshot/slot handoff before starting replication on any recovered branch.
This capability leaves the project’s management credentials writable. For a read-only mirror, keep those out of application processes and establish independently verified read-only application roles before connecting an application. Do not run email, payout, webhook, alert, or maintenance workers against replicated job records. Native apply normally bypasses ordinary triggers; audit any ALWAYS/REPLICA triggers separately.
See the PostgreSQL subscription reference, replication restrictions, and your source provider’s replication and retention documentation before authorizing a live setup.