Transactions and insertion ordering

Поиск
Список
Период
Сортировка
От James Pharaoh
Тема Transactions and insertion ordering
Дата
Msg-id 1086856130.6365.4.camel@styx.phsys.co.uk
обсуждение исходный текст
Ответы Re: Transactions and insertion ordering
Список pgsql-general
Hi,

I'm trying to work out how to make sure things are read from a table in
a consistent order. The table represents a queue of items and also the
history of those items.

Even with "serializable" transaction isolation I can begin two
transactions, insert a record in each, commit the second transaction
first. This second record is now visible and can be read from the queue.
But when I commit the first this one appears before the second one. This
could then be read from the queue second but when I rescan the table to
view history it looks like it was read first.

Are there any ways to make this work a little more intuitively?
Basically I guess I want to be able to model a queue effectively.

James


В списке pgsql-general по дате отправления:

Предыдущее
От: Holger Klawitter
Дата:
Сообщение: Re: How to tell when postmaster is ready
Следующее
От: Richard Huxton
Дата:
Сообщение: Re: How to tell when postmaster is ready