Re: Postgresql "FIFO" Tables, How-To ? - Mailing list pgsql-general

From Tom Lane
Subject Re: Postgresql "FIFO" Tables, How-To ?
Date
Msg-id 25649.1058394448@sss.pgh.pa.us
Whole thread Raw
In response to Re: Postgresql "FIFO" Tables, How-To ?  (Thomas Kellerer <spam_eater@gmx.net>)
Responses Re: Postgresql "FIFO" Tables, How-To ?  (Thomas Kellerer <spam_eater@gmx.net>)
List pgsql-general
Thomas Kellerer <spam_eater@gmx.net> writes:
> But isn't that exactly the problem? Once the sequence wraps around how do I
> know that id=1 is actually later then id=2 without a date column?

If you use an int8 sequence column, I doubt you need to worry about
wraparound.  A date column probably hasn't got enough resolution,
so the other workable approach is to use a timestamp column.  Ends up
costing 8 bytes either way.

            regards, tom lane

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Billions of records?
Next
From: "Rui Pires"
Date:
Subject: ERROR: UNIQUE constraint matching given keys for referenced table "rl_voltas" not found