Re: SERIAL order and INSERT order - Mailing list pgsql-novice

From Thomas Kellerer
Subject Re: SERIAL order and INSERT order
Date
Msg-id it9mhs$ovc$1@dough.gmane.org
Whole thread Raw
In response to SERIAL order and INSERT order  (l1@nym.hush.com)
Responses Re: SERIAL order and INSERT order  (Bob McConnell <rmcconne@lightlink.com>)
List pgsql-novice
l1@nym.hush.com, 14.06.2011 20:30:

> Are there any cases where an observer might see a row with serial
> number 2 but not yet see serial number 1, perhaps because thread 1
> hasn't completed its insert yet?  For example SELECT * WHERE
> seqnumber<  3; would return only a row with seqnumber=2?

It is never a good idea to rely on the numeric ordering of a generated PK column. If you really need to know in which
orderrows were inserted you should use a timestamp that is recording that time (although I believe the resolution of a
timestampcolumn might be not fine enough..) 

Regards
Thomas

pgsql-novice by date:

Previous
From: Merlin Moncure
Date:
Subject: Re: SERIAL order and INSERT order
Next
From: Bob McConnell
Date:
Subject: Re: SERIAL order and INSERT order