Re: collision in serial numbers after INSERT? - Mailing list pgsql-general

From Tom Lane
Subject Re: collision in serial numbers after INSERT?
Date
Msg-id 22658.1180728034@sss.pgh.pa.us
Whole thread Raw
In response to Re: collision in serial numbers after INSERT?  (Michael Glaesemann <grzm@seespotcode.net>)
Responses Re: collision in serial numbers after INSERT?
List pgsql-general
Michael Glaesemann <grzm@seespotcode.net> writes:
> On May 31, 2007, at 11:46 , lawpoop@gmail.com 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.

            regards, tom lane

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Slightly OT.
Next
From: "Joshua D. Drake"
Date:
Subject: Re: multimaster