PostgreSQL Logical Replication with Multiple Databases and Schemas #17853
Unanswered
syamlakkepogu
asked this question in
Help
Replies: 1 comment
-
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Uh oh!
There was an error while loading. Please reload this page.
-
Hello everyone,
I have one main database db1 that contains multiple schemas:
db1.s1
db1.s2
db1.s3
db1.s3
db1.s4
I also have four separate databases, and each database uses the default public schema:
db2.public
db3.public
db4.public
db5.public
I want to set up PostgreSQL logical replication using Publication and Subscription with the following mapping:
db2.public → db1.s1
db3.public → db1.s2
db4.public → db1.s3
db5.public → db1.s4
My requirement is:
All INSERT, UPDATE, and DELETE operations from db2, db3, db4, and db5 should be replicated to db1.
Data from each source database’s public schema should be synced to a specific schema in db1.
I would like to know:
Is this setup possible using PostgreSQL logical replication?
Does PostgreSQL support schema mapping (public → custom schema) during replication?
If not, what is the recommended approach for this use case?
Any guidance or examples would be greatly appreciated.
Thank you.
Beta Was this translation helpful? Give feedback.
All reactions