Re: Duplicate rows sneaking in despite PRIMARY KEY / UNIQUE constraint - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Duplicate rows sneaking in despite PRIMARY KEY / UNIQUE constraint
Date
Msg-id 16881.1149603582@sss.pgh.pa.us
Whole thread Raw
In response to Duplicate rows sneaking in despite PRIMARY KEY / UNIQUE constraint  (Travis Cross <travis@crosswirecorp.com>)
Responses Re: Duplicate rows sneaking in despite PRIMARY KEY / UNIQUE constraint  ("Ian Barwick" <barwick@gmail.com>)
Re: Duplicate rows sneaking in despite PRIMARY KEY / UNIQUE  (Travis Cross <travis@crosswirecorp.com>)
List pgsql-hackers
Travis Cross <travis@crosswirecorp.com> writes:
> I'm noticing that a handful (4-16) of rows with duplicate columns
> (uid,token) are sneaking into the table every day despite the
> primary key constraint.

Corrupt index, looks like ... you might try reindexing the index.

I don't believe that the PANIC you show has anything directly to do
with duplicate entries.  It is a symptom of corrupt index structure.
Now a corrupt index might also explain failure to notice duplications,
but changing your application isn't going to fix whatever is causing
it.  You need to look for server-side causes.

Any database or system crashes on this server (before this problem
started)?  Do you *know* that the disk drive will not lie about write
complete?  What is the platform and storage system, anyway?
        regards, tom lane


pgsql-hackers by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: That EXPLAIN ANALYZE patch still needs work
Next
From: Tom Lane
Date:
Subject: Re: fillfactor using WITH syntax