Re: duplicate sequence, it is possible?

From: Alban Hertroys <haramrae(at)gmail(dot)com>
To: Anibal David Acosta <aa(at)devshock(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: duplicate sequence, it is possible?
Date: 2011-09-19 06:19:18
Message-ID: 9E91E522-5B17-4ACF-A8B2-047736A50908@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 19 Sep 2011, at 2:57, Anibal David Acosta wrote:

> Hi everyone.
>
> I have a table with a PK, this table has a lot of insert per second (100 ~ 150 insert /sec)
> Sometimes, a get a duplicate key error, but ID is generated from a function (VOLATILE). This function has just one line (select nextval('XXX'))
>
> Is possible that this function return same ID for two diff call?
>
> Postgres version is 9.0
>
> Thanks!

Very unlikely.
Are you certain that you're not just hitting pre-existing rows that have ID's higher than the starting ID of your sequence? Or that there isn't another process inserting rows without using the sequence?

Alban Hertroys

--
Screwing up is an excellent way to attach something to the ceiling.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Thomas Kellerer 2011-09-19 06:38:59 Re: Indexes not allowed on (read-only) views: Why?
Previous Message Scott Marlowe 2011-09-19 06:14:14 Re: index row requires 10040 bytes, maximum size is 8191