Skip site navigation (1) Skip section navigation (2)

Very worried about this

From: Kris Kiger <kris(at)musicrebellion(dot)com>
To: "Pgsql-Admin (E-mail)" <pgsql-admin(at)postgresql(dot)org>
Subject: Very worried about this
Date: 2005-03-24 21:21:12
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-admin
I have a table that looks like this:

                                              Table "public.hd"
      Column       |            Type             
|                                Modifiers
 d_id        | integer                     | not null default 
 h_id        | integer                     | not null
 src            | text                        |
 p_q | integer                     | not null default 1
 c_id        | integer                     | not null
 insert_time       | timestamp without time zone | default now()
    "hd_pkey" PRIMARY KEY, btree (d_id)
    "hd_idx" btree (h_id, c_id)

_Log output:_

[2005-03-24 15:33:25 EST - 13882 - dbname - 4052774] LOG:  statement: 
INSERT INTO hd (c_id, h_id, p_q) VALUES ((SELECT c_id FROM c WHERE e_id 
= 'tester1'), (SELECT h_id FROM h JOIN c USING (c_id) WHERE e_id = 
'tester1' AND AND NOT p_c),10);

[2005-03-24 15:33:25 EST - 13882 - dbname - 4052774] ERROR:  duplicate 
key violates unique constraint "hd_pkey"

These inserts are being executed ever 1.5 seconds on this database.  
This error does not happen often and appears to happen randomly.  No 
other inserts are being executed on this table except this one.  From 
our current tests 99% of the inserts go through, with the exception of 
these few.  Honestly, I don't see how this could be caused from 
something on my end.  The primary key value is being determined by a 
default, so everything should be handled within the database.  I'm using 
postgres 8.0.1.  Any ideas?

Thanks for the assist!



pgsql-admin by date

Next:From: Scott MarloweDate: 2005-03-24 21:37:44
Subject: Re: Very worried about this
Previous:From: Michael FuhrDate: 2005-03-24 19:50:59
Subject: Re: Copying large tables with DBLink

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group