Re: Sync 2 tables in 2 databases

From: SHARMILA JOTHIRAJAH <sharmi_jo(at)yahoo(dot)com>
To: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
Cc: General postgres mailing list <pgsql-general(at)postgresql(dot)org>
Subject: Re: Sync 2 tables in 2 databases
Date: 2009-03-11 19:26:35
Message-ID: 41883.15655.qm@web110706.mail.gq1.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

--- On Wed, 3/11/09, Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com> wrote:

> >
> > Hi,
> > I have 2 postgres databases with similar structure. I
> want to keep some tables in sync in these 2 databases(They
> can be synced just once a day). Is there a way to archive
> this using function ?
> > Something like....
> >
> > Select syncTable('foo')
> >
> > where syncTable is a function that compares table
> 'foo' in db1 with table 'foo' in db2 and make
> changes(update/insert/delete) to 'foo' in db1
>
> You can either truncate it on the destination db every so
> often, then
> dump / restore the data back into it, drop it and restore
> it, write a
> simple replication script that looks for missing /
> updated rows, or
> my suggestion, set up replication with slony and be done
> with it. Of
> course, you don't mention if you need one or two way
> synchronization,
> which makes a big difference in how you choose to do
> things.
>

It is just 1 way synchronization... replication with slony sounds pretty good... ill try that out
Thanks

Responses

Browse pgsql-general by date

  From Date Subject
Next Message SHARMILA JOTHIRAJAH 2009-03-11 19:29:58 Re: Sync 2 tables in 2 databases
Previous Message Scott Marlowe 2009-03-11 19:23:31 Re: Sync 2 tables in 2 databases