views:

116

answers:

4

I have a postgresql server process each running in my desktop and the laptop.

Both servers have a database called MG with exactly same scheme/layout. Now I enter the data in to similar tables but at differing times.

I generally keep the primary keys seperate so that they don't clash with each other. eg: oddnumber pkey for laptop and even number for desktop.

Now how do I syncronize the data between the desktop and laptop cleanly!

Any advise would be greatly appreciated.

DESK:ADDRESS ----- LAP:ADDRESS DESK:TO_DO ----- LAP:TO_DO

DESK uses pkeys like 1001... for inserts LAP uses pkeys like 2001... for inserts

I need both update for the modified records and insert for new records. But how do I :-( ..

+1  A: 

It looks like rubyrep would work for you.

Tometzky
is there any other choice?
yjfuk
@yjfuk: and what is the problem with rubyrep?
depesz
A: 

The simplest way would be to write a custom script/program. It's not difficult, and definitely you will know and understand how it works, so extending it will be trivial.

depesz
would you give me some principle for how it works?
yjfuk
Well, it will work the way you'll write it. Generally everything depends on what your applications does with database.Simplistic approach: check newest id replicated to another database, and copy over all new ones.
depesz
A: 

Please refer to PostgreSQL documentation for High Availability, Load Balancing, and Replication

Space
+1  A: 

Use Slony-I to do postgreSQL synchronization.

nont
Slony-I does not support multi-master replication, so it will not work here.
Tometzky