Data exchange between 2 remote postgresql databases
If you only need one-way sync then I strongly recommend Londiste. For two-way, Londiste 3 or Bucardo can both do what you want with trigger-based replication.

Some ETL tools can do periodic table syncs, including two-way merges. Look into CloverETL, Pentaho Kettle, Talend Studio.

Don't try to roll your own. It's harder than you think.

The BDR project is working toward adding this to PostgreSQL, hopefully in 9.5, but it's currently in early development; I'm mentioning it so you're aware it exists for the future, and for later readers.