Re: Duplicate primary key record - Mailing list pgsql-bugs

From Stephan Szabo
Subject Re: Duplicate primary key record
Date
Msg-id 20031115222707.F48099@megazone.bigpanda.com
Whole thread Raw
In response to Duplicate primary key record  (Joel Jacobson <joel@jacobson.be>)
Responses Re: Duplicate primary key record  (Joel Jacobson <joel@jacobson.be>)
List pgsql-bugs
On Sun, 16 Nov 2003, Joel Jacobson wrote:

> Please enter a FULL description of your problem:
> ------------------------------------------------
> I have simple table with a primary key.
> Somehow two records with the SAME primary key has managed to get into the
> table.
> This should as far as I know be impossible.
> I should mention that my Postgres daemon crashed two times today when I was
> increasing its memory usage setting.
> I guess this could have something to do with the problem.
>
>                                                      Table
> "public.userbalances"
>       Column      |     Type      |
> Modifiers
>
------------------+---------------+--------------------------------------------------------------------------------------------------
>  userid           | integer       | not null
>  balance          | numeric(12,2) | not null
>  reservedbalance  | numeric(12,2) | not null
>  modificationdate | integer       | not null default (date_part('epoch'::text,
> ('now'::text)::timestamp(6) with time zone))::integer
> Indexes: userbalances_pkey primary key btree (userid)
> Foreign Key constraints: $1 FOREIGN KEY (userid) REFERENCES users(userid) ON
> UPDATE NO ACTION ON DELETE NO ACTION
> Triggers: autostamp
>
> pbs=> select * from userbalances where userid = 1002024;
>  userid  | balance  | reservedbalance | modificationdate
> ---------+----------+-----------------+------------------
>  1002024 | 10000.00 |          154.02 |       1068947725
>  1002024 | 10000.00 |          727.57 |       1068949964
> (2 rows)

Hmm, what does select oid,xmin,xmax,* where userid=1002024; give?

pgsql-bugs by date:

Previous
From: Neil Conway
Date:
Subject: Re: RC2 will not make check on OSX 10.3
Next
From: Dennis Bjorklund
Date:
Subject: 7.5devel - duplicate error message