Re: Tracking row updates - race condition

From: "Vincent Hikida" <vhikida(at)inreach(dot)com>
To: "Alex Adriaanse" <alex(at)alexandcarmen(dot)com>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: Tracking row updates - race condition
Date: 2005-03-21 04:16:29
Message-ID: 00a301c52dcc$c26d04b0$6501a8c0@HOMEOFFICE
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

>
> To fetch all updates since the last synchronization, the client would
> calculated a value for $lastrevision by running this query on its local
> database:
> SELECT max(revision) AS lastrevision FROM codes;
>
> It would then fetch all updated rows by running this query against the
> server:
> SELECT * FROM codes WHERE revision > $lastrevision;
>

How about

SELECT * FROM codes WHERE revision > $lastrevision - 100

You could use another number other than 100. As you said, the client can
handle duplicates.

Vincent

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Joshua D. Drake 2005-03-21 04:22:43 Re: Copression
Previous Message Kris Jurka 2005-03-21 04:09:03 Re: java.lang.OutOfMemoryError