Re: SERIAL order and INSERT order
| От | Merlin Moncure |
|---|---|
| Тема | Re: SERIAL order and INSERT order |
| Дата | |
| Msg-id | BANLkTikuJdtguDs8UiCgsAJMELB8dBu_-Q@mail.gmail.com обсуждение исходный текст |
| Ответ на | SERIAL order and INSERT order (l1@nym.hush.com) |
| Список | pgsql-novice |
On Tue, Jun 14, 2011 at 1:30 PM, <l1@nym.hush.com> wrote: > Hi > > I have a table defined as follows: > > CREATE TABLE mytable ( > seqnumber BIGSERIAL; > ... > ) > > and I have multiple threads inserting into the table. > > If multiple threads insert at the same time, will the sequence > numbers generated always appear in the table in order? It's going to depend on how you define 'order'. I take it you mean transaction commit order based on time. sequence numbers are always *fetched* in order. however, if two separate threads are grabbing numbers and inserting them roughly a the same time, there could be a race to transaction commit (although I wonder how that could possibly matter, since your app is multi threaded and there is no distinguishing information outside of the sequence value itself). merlin
В списке pgsql-novice по дате отправления: