| From: | Thomas Kellerer <spam_eater(at)gmx(dot)net> |
|---|---|
| To: | pgsql-general(at)postgresql(dot)org |
| Subject: | Re: Postgresql "FIFO" Tables, How-To ? |
| Date: | 2003-07-17 13:22:48 |
| Message-ID: | bf67tb$1hm$1@main.gmane.org |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
Tom Lane schrieb:
> Thomas Kellerer <spam_eater(at)gmx(dot)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.
>
I'm aware of that, I was referring to Sean's comment:
> The nifty thing about using a wrapping sequence is that the id's are
> sequential across transactions, which correctly maps to the
> progression of time, which obviates the need for relying on any kind
> of a date column for doing syslog message ordering.
If you only use the id, you can't really tell the message ordering by
the ID as id=1 could well be inserted *after* id=2 due to the wrapping
of the sequence
Cheers
Thomas
| From | Date | Subject | |
|---|---|---|---|
| Next Message | scott.marlowe | 2003-07-17 14:35:32 | Re: Where is the physical files of database that I just |
| Previous Message | Alvaro Herrera | 2003-07-17 13:18:35 | Re: Cache Query.. |