Re: Help with pre-loaded arbitrary key sequences
От
Scott Marlowe
Тема
Re: Help with pre-loaded arbitrary key sequences
Дата
Msg-id
dcc563d10801170848p4b2ddb6bid8e848df70be7761@mail.gmail.com
Ответ на
Re: Help with pre-loaded arbitrary key sequences (James B. Byrne)
Список
Дерево обсуждения
Help with pre-loaded arbitrary key sequences "James B. Byrne" <byrnejb@harte-lyne.ca>
Re: Help with pre-loaded arbitrary key sequences Martijn van Oosterhout <kleptog@svana.org>
Re: Help with pre-loaded arbitrary key sequences "Scott Marlowe" <scott.marlowe@gmail.com>
Re: Help with pre-loaded arbitrary key sequences "James B. Byrne" <byrnejb@harte-lyne.ca>
Re: Help with pre-loaded arbitrary key sequences "Scott Marlowe" <scott.marlowe@gmail.com>
Re: Help with pre-loaded arbitrary key sequences "James B. Byrne" <byrnejb@harte-lyne.ca>
Re: Help with pre-loaded arbitrary key sequences "Scott Marlowe" <scott.marlowe@gmail.com>
Re: Help with pre-loaded arbitrary key sequences "Scott Marlowe" <scott.marlowe@gmail.com>
Re: Help with pre-loaded arbitrary key sequences "James B. Byrne" <byrnejb@harte-lyne.ca>
On Jan 17, 2008 9:19 AM, James B. Byrne wrote: > > On Thu, January 17, 2008 10:15, Scott Marlowe wrote: > > > > If race conditions are a possible issue, you use a sequence and > > increment that until you get a number that isn't used. That way two > > clients connecting at the same time can get different, available > > numbers. > > > > That is close to the idea that I originally had. I was simply wondering > if the built-in sequencer could handle this case or whether I need to roll > my own. Got bored, hacked this aggregious pl/pgsql routine up. It looks horrible, but I wanted it to be able to use indexes. Seems to work. Test has ~750k rows and returns in it and returns a new id in < 1ms on my little server. File attached.
В списке pgsql-general по дате отправления