Re: Replication MSSQL-PostgreSQL - any success? - Mailing list pgsql-admin

From D Yeager
Subject Re: Replication MSSQL-PostgreSQL - any success?
Date
Msg-id 200211141346.58324.dyeager@teleport.com
Whole thread Raw
In response to Re: Replication MSSQL-PostgreSQL - any success?  (Chris Miles <chris_pg002@psychofx.com>)
List pgsql-admin
> Hi, actually what I was after was a continuous way to keep a
> PostgreSQL db in sync with a changing MSSQL db.

> Once the data is migrated, a method of syncing any updates
> in the MSSQL db to the PostgreSQL db is what we require.
> I haven't discovered a nice way of doing that yet.

I've setup an active sync between an AS400->MSSQL which would work for
MSSQL->Postgres.

What you need to to is create a trigger on the MSSQL side which writes to a
separate table the key fields from the changed table. You then write a
program (mine's in Java on the AS400) which checks the tables the trigger
wrote, fetches the new data, and updates the target database (postgres).
Simply keep the check in a continuous loop (I actually wait a few minutes
between checks) and all your data is kept in sync almost realtime.

If you do use Java for this, the advantage is you can sync anything with a
JDBC driver, although it's probably not the fastest way to do it.

pgsql-admin by date:

Previous
From: Robert Treat
Date:
Subject: Re: News Server Problems
Next
From: Tom Lane
Date:
Subject: Re: VACUUM