title: synchronize two pg databases
body: <p>I have a postgresql server process each running in my desktop and the laptop.</p>
  
  <p>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.</p>
  
  <p>I generally keep the primary keys separate so that they don't clash with each other. eg: oddnumber pkey for laptop and even number for desktop.</p>
  
  <p>Now how do I synchronize the data between the desktop and laptop cleanly?</p>
  
  <pre><code>DESK:ADDRESS ----- LAP:ADDRESS
  DESK:TO_DO   ----- LAP:TO_DO
  </code></pre>
  
  <p>DESK uses pkeys like 1001... for inserts<br/>
  LAP uses pkeys like 2001... for inserts</p>
  
  <p>I need both update for the modified records and insert for new records. But how?</p>