Re: collision in serial numbers after INSERT?

From: Steve Lefevre <lefevre(dot)10(at)osu(dot)edu>
To: Bill Moran <wmoran(at)potentialtech(dot)com>
Cc: lawpoop(at)gmail(dot)com, pgsql-general(at)postgresql(dot)org
Subject: Re: collision in serial numbers after INSERT?
Date: 2007-06-01 23:02:20
Message-ID: 4660A57C.6050101@osu.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Bill Moran wrote:
> Don't do that. Please let us know what site recommended that so I can
> send an email to the author correcting them.
>
Hello Bill -

The 'offending' site and article is at
http://www.sitepoint.com/article/site-mysql-postgresql-2/3

> Instead, do SELECT currval('<seqname>'), which is guaranteed to be isolated
> from other sessions.
>
I've also gotten other advice to SELECT next_val ( whatever the exact
wording is) will reserve that serial number for you. Is that true?

So l
> If you use the code above, sooner or later you're going to get bit.
>
Thanks!

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ron Johnson 2007-06-01 23:15:40 One last Slony question (was Re: Slightly OT.)
Previous Message Jeff Davis 2007-06-01 23:01:30 Re: Slightly OT.