Re: [INTERFACES] Replication between MS Access and PostgreSQL

From: Alain TESIO <alain_tesio(at)yahoo(dot)com>
To: pgsql-interfaces(at)postgreSQL(dot)org
Subject: Re: [INTERFACES] Replication between MS Access and PostgreSQL
Date: 1999-10-28 09:11:29
Message-ID: 19991028091129.15862.rocketmail@web303.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

--- Nicolas Huillard <nhuillard(at)ghs(dot)fr> wrote:
> This description is a way to export tables from Access to Postgres.
> I know how to do this.
> What I'm looking for is a tool to synchronize the data between the
> same table inside Access and Postgres, ie : a new record in
> Postgres should be transfered to Access, and the same the other
> way.
>
> Thanks.

If you only need to transfer new rows and don't care about
updated or deleted rows, it's pretty easy to do, especially if you
have an identifier in your table generated by a sequence
(or the date it was inserted).

in Postgres :

table DATA (rowid, other_columns), index on rowid
table LAST_CHECK (rowid) -- one row in this table

select @rowid1=rowid from LAST_CHECK
select @rowid2=max(rowid) from DATA
select * from DATA where @rowid1 < rowid <= @rowid2
update from LAST_CHECK set rowid=(at)rowid2

(Sybase-like syntax for variables, sorry ...)

And something similar in Access.
You must have a cron job which runs this script periodically
and insert the resultset from the third instruction into Access.
It doesn't need to be transactional.
The both databases should generate identifiers on non-overlapping
ranges, for example negative in Access, replace max by min for the
other script and reverse the comparison order.

Alain

=====

signoff

__________________________________________________
Do You Yahoo!?
Bid and sell for free at http://auctions.yahoo.com

Browse pgsql-interfaces by date

  From Date Subject
Next Message Ibrahim Shaame 1999-10-28 09:35:11 How to fetch my mails from Hotmail
Previous Message Ina 1999-10-28 09:04:21 Insertion Error