Logical Replication with Render Postgres
Subscribe to data changes from a publisher database.
Render Postgres databases do not enable logical replication by default.
See prerequisites and enablement steps below.
PostgreSQL logical replication enables "subscriber" databases to continually pull data changes from a "publisher" database. Unlike with read replicas, these subscriber databases do not need to be Render-managed.
Prerequisites
- Your workspace must be on a Pro plan or higher. See pricing.
- Your database must have at least 10 GB of storage.
Steps to enable
To enable logical replication, please reach out to our support team in the Render Dashboard.
In your message, provide all of the following information:
- The service ID for each Render Postgres database you want to enable logical replication for (both publishers and subscribers).
- This value is available from your database's Info page (starts with
dpg-).
- This value is available from your database's Info page (starts with
- For each publisher database, the name of the PostgreSQL role subscribers will use to connect to it.
- We recommend creating a dedicated read-only user for this purpose.
- The names of all schemas that subscribers will read from.
- Specifically note if you want to publish all tables for a particular database.
- The command
CREATE PUBLICATION [name] FOR ALL TABLESrequires superuser privileges and must be executed by our support team. - Commands of the form
CREATE PUBLICATION [name] FOR TABLE…can be executed by you.
- The command
Here's a template you can use for your message:
Creating publications and subscriptions
After logical replication is enabled, you can do the following:
-
On your "publisher" database, create a publication for the tables you want to replicate.
Common examples include:
-
On each "subscriber" database, create a subscription that points to the publication on the publisher:
Learn more in the PostgreSQL documentation for CREATE PUBLICATION and CREATE SUBSCRIPTION.