Re: "duplicate key value violates unique constraint" ERROR - Mailing list pgsql-admin

From Ian Lea
Subject Re: "duplicate key value violates unique constraint" ERROR
Date
Msg-id j2n8c4e68611005050336naa9b8438rfb552b059d281592@mail.gmail.com
Whole thread Raw
In response to "duplicate key value violates unique constraint" ERROR  (Renato Oliveira <renato.oliveira@grant.co.uk>)
Responses Re: "duplicate key value violates unique constraint" ERROR
List pgsql-admin
The most likely cause is surely application error: your application is
attempting to insert rows into a table and those new rows have the
primary key set to a value that is already present for that table.
Could be the app isn't checking properly before doing an insert (or
update), could be you are trying to load data twice, could be whatever
is generating the data in the first place is generating duplicates,
etc.

Seems unlikely that the exception itself would cause your system to
slow down but whatever is causing the exception (trying to load
everything multiple times?) might be.


--
Ian.



On Wed, May 5, 2010 at 11:22 AM, Renato Oliveira
<renato.oliveira@grant.co.uk> wrote:
> Dear all,
>
>
>
> I am sorry to have another post.
>
> I have been following a problem which has been growing fast on our system.
>
>
>
> At the beginning I thought it was related to load on PG server, then I
> thought it was load on the switch/network, now I don’t know.
>
>
>
> We seem to get loads of Exception errors and when I look at the Postgres Log
> there are loads of “duplicate key value violates unique constraint”
>
>
>
> I have researched on the Internet and some posts say: Reindex, some say bug
> in JIRA.
>
> Some say: Your primary key index isn't in sync.
>
>
>
> Have you guys suffered from this problem before, or have seen it anywhere?
>
>
>
> From 30th of April to today I got 1400 errors.
>
> What do you guys think might cause this behavior?
>
> I also think it is causing the system to slow down a bit, do you think that
> might be possible?
>
>
>
> Very much appreciate any help, insight, opinion or anything you could think.
>
>
>
> Thank you very much
>
>
>
>
>
> Best regards
>
>
>
> Renato
>
>
>
>
> Renato Oliveira
> Systems Administrator
> e-mail: renato.oliveira@grant.co.uk
>
> Tel: +44 (0)1763 260811
> Fax: +44 (0)1763 262410
> www.grant.co.uk
>
> Grant Instruments (Cambridge) Ltd
>
> Company registered in England, registration number 658133
>
> Registered office address:
> 29 Station Road,
> Shepreth,
> CAMBS SG8 6GB
> UK
>
>
>
>
>
>
>
> P Please consider the environment before printing this email
>
> CONFIDENTIALITY: The information in this e-mail and any attachments is
> confidential. It is intended only for the named recipients(s). If you are
> not the named recipient please notify the sender immediately and do not
> disclose the contents to another person or take copies.
>
> VIRUSES: The contents of this e-mail or attachment(s) may contain viruses
> which could damage your own computer system. Whilst Grant Instruments
> (Cambridge) Ltd has taken every reasonable precaution to minimise this risk,
> we cannot accept liability for any damage which you sustain as a result of
> software viruses. You should therefore carry out your own virus checks
> before opening the attachment(s).
>
> OpenXML: For information about the OpenXML file format in use within Grant
> Instruments please visit our website

pgsql-admin by date:

Previous
From: Renato Oliveira
Date:
Subject: "duplicate key value violates unique constraint" ERROR
Next
From: Renato Oliveira
Date:
Subject: Re: "duplicate key value violates unique constraint" ERROR