Re: table as log (multiple writers and readers)

From: Andrew Sullivan <ajs(at)crankycanuck(dot)ca>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: table as log (multiple writers and readers)
Date: 2008-04-17 04:53:26
Message-ID: 20080417045326.GB1719@crankycanuck.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Oh, one other thing

On Thu, Apr 17, 2008 at 12:44:51PM +0800, Craig Ringer wrote:

> > One way I can think of doing it is to write a seen_log that notes what the
> > client has already seen with a timestamp of (say) 1 minute. Then you can
> > say "go forward from this time excluding ids (ids here)".
>
> It won't work with multiple concurrent writers. There is no guarantee
> that an INSERT with a timestamp older than the one you just saw isn't
> waiting to commit.

Yeah, I spoke imprecisely. The idea is, "Start at timestamp _t_, but don't
re-process these ones, which I've seen." The trick is to set your start _t_
far enough back in time that it's incompatible with your business logic that
anything could still be pending from then. This is nasty and prone to bugs,
but it can be coded up.

A

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Klint Gore 2008-04-17 06:58:58 pg 8.3.0 unexpected sending network packet?
Previous Message Andrew Sullivan 2008-04-17 04:51:00 Re: table as log (multiple writers and readers)