From: Michael Fuhr <mike@fuhr.org>
To: Robert Perry <rlperry@lodestonetechnologies.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: Duplicate Key -- Have I missed something
Date: Sat, 6 Aug 2005 20:47:02 -0600
Message-ID: <20050807024702.GA78766@winnie.fuhr.org> (raw)
In-Reply-To: <2994A7D7-EB9B-47B6-B782-BA0E6A71187D@lodestonetechnologies.com>
References: <2994A7D7-EB9B-47B6-B782-BA0E6A71187D@lodestonetechnologies.com>
On Sat, Aug 06, 2005 at 10:00:10PM -0400, Robert Perry wrote:
> I have a production environment that is running the code that
> caused this problem about once every 30 seconds or so, with two
> clients. It normally runs very well, but I was suddenly hit with a
> duplicate key violation for a table where the primary key is
> generated in part from sequence.
>
> How might this have happen?
Have any values been inserted that weren't obtained from the sequence?
What are the results of the following queries?
SELECT max(tid) FROM game_pay_cash_coupon_trans;
SELECT * FROM game_pay_cash_coupon_trans_seq;
(You already showed the second query, but let's see it again run at
the same time as the first).
--
Michael Fuhr
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: mike@fuhr.org, rlperry@lodestonetechnologies.com
Subject: Re: Duplicate Key -- Have I missed something
In-Reply-To: <20050807024702.GA78766@winnie.fuhr.org>
References: <2994A7D7-EB9B-47B6-B782-BA0E6A71187D@lodestonetechnologies.com> <20050807024702.GA78766@winnie.fuhr.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox