Re: Duplicate Key -- Have I missed something - Mailing list pgsql-admin

From Michael Fuhr
Subject Re: Duplicate Key -- Have I missed something
Date
Msg-id 20050807024702.GA78766@winnie.fuhr.org
Whole thread Raw
In response to Duplicate Key -- Have I missed something  (Robert Perry <rlperry@lodestonetechnologies.com>)
Responses Re: Duplicate Key -- Have I missed something  (Robert Perry <rlperry@lodestonetechnologies.com>)
List pgsql-admin
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

pgsql-admin by date:

Previous
From: Robert Perry
Date:
Subject: Duplicate Key -- Have I missed something
Next
From: Robert Perry
Date:
Subject: Re: Duplicate Key -- Have I missed something