2

I am just wondering whether it would be possible to replicate only a table in a postgres database with another database instance. For example, lets say that I have a postgres instance running at hostA and another instance at hostB. Lets say i have a relation called "user" in a database called "database1" in hostA and i want to replicate this with a different database called "database2" at hostB. How can we go about it?

1
  • I was able to do it using "SQL Generator" from IntelliJ's DBMS tool(Data Grip). Commented Feb 26, 2024 at 17:20

1 Answer 1

7

Slony-I can do this: http://slony.info/documentation/2.1/preface.html#INTRODUCTION

But Slony might be quite an overhead if it's really only a single table.

For just a single table you could write a trigger that updates the table on the other host through DbLink.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.