Re: duplicate key violates unique constraint pg_toast_635216540 - Mailing list pgsql-bugs

From Tom Lane
Subject Re: duplicate key violates unique constraint pg_toast_635216540
Date
Msg-id 22210.1161015912@sss.pgh.pa.us
Whole thread Raw
In response to duplicate key violates unique constraint pg_toast_635216540  ("Paul Laughlin" <plaughlin@gmail.com>)
Responses Re: duplicate key violates unique constraint pg_toast_635216540  ("Paul Laughlin" <plaughlin@gmail.com>)
List pgsql-bugs
"Paul Laughlin" <plaughlin@gmail.com> writes:
> For the last 6 months or so we've had an intermittent issue while doing a
> data import with a simple update statement.  The fix that we've found for
> this issue is to REINDEX TABLE <tablename>;

What PG version is this?

Are you sure that the REINDEX actually does anything, as opposed to
merely retrying the data import?  I'm thinking you may be having
problems with OID collisions after OID wraparound, which is something
8.1 should defend against but no earlier version does.

What do you get from
    select count(distinct chunk_id) from pg_toast.pg_toast_635216540 ;

            regards, tom lane

pgsql-bugs by date:

Previous
From: "Paul Laughlin"
Date:
Subject: duplicate key violates unique constraint pg_toast_635216540
Next
From: "Paul Laughlin"
Date:
Subject: Re: duplicate key violates unique constraint pg_toast_635216540