Re: SERIAL order and INSERT order

Поиск
Список
Период
Сортировка
От Thomas Kellerer
Тема Re: SERIAL order and INSERT order
Дата
Msg-id it9mhs$ovc$1@dough.gmane.org
обсуждение исходный текст
Ответ на SERIAL order and INSERT order  (l1@nym.hush.com)
Ответы Re: SERIAL order and INSERT order  (Bob McConnell <rmcconne@lightlink.com>)
Список 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 по дате отправления:

Предыдущее
От: Merlin Moncure
Дата:
Сообщение: Re: SERIAL order and INSERT order
Следующее
От: Bob McConnell
Дата:
Сообщение: Re: SERIAL order and INSERT order