Search Postgresql Archives

Re: collision in serial numbers after INSERT?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Jun 1, 2007, at 15:00 , Tom Lane wrote:

Michael Glaesemann <grzm@xxxxxxxxxxxxxxx> writes:
On May 31, 2007, at 11:46 , lawpoop@xxxxxxxxx wrote:
However, I wondered, if I were in an environment where there were many concurrent inserts, would it be possible that I didn't get the serial
number of the insert that *I* just did?

No.

Uh, yes, because he was using "SELECT last_value FROM seq" which is
indeed subject to race conditions.  currval() would be far safer.

I read that much too quickly. My apologies, lawpoop. And thanks, Tom.

Michael Glaesemann
grzm seespotcode net




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux