Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id A392A9FA350 for ; Mon, 16 Oct 2006 13:45:46 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 81261-08 for ; Mon, 16 Oct 2006 16:45:38 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.189]) by postgresql.org (Postfix) with ESMTP id 8F5679FA2C7 for ; Mon, 16 Oct 2006 13:45:36 -0300 (ADT) Received: by nf-out-0910.google.com with SMTP id x4so2630113nfb for ; Mon, 16 Oct 2006 09:45:35 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=R+LPIUOLhIFWbBcUEcdKIL1ETlwPqGjvnOgMoan5IZGVoWzwdlUxHEY6f+NSFWKdxAVEFuPTl0Xbq3TwuHnTPbxwXtpOdKfr5846ZA8bWbJe/5fj6O5sKDMBr2IUd4qmE5oXGOY0nVqJvDXMfmfplRJfYk5kCt6z9QiLm+8Mw6o= Received: by 10.82.123.16 with SMTP id v16mr1137913buc; Mon, 16 Oct 2006 09:45:35 -0700 (PDT) Received: by 10.82.109.14 with HTTP; Mon, 16 Oct 2006 09:45:35 -0700 (PDT) Message-ID: Date: Mon, 16 Oct 2006 09:45:35 -0700 From: "Paul Laughlin" To: "Tom Lane" Subject: Re: duplicate key violates unique constraint pg_toast_635216540 Cc: pgsql-bugs@postgresql.org In-Reply-To: <22210.1161015912@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_62889_13508428.1161017135623" References: <22210.1161015912@sss.pgh.pa.us> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.696 tagged_above=0 required=5 tests=DNS_FROM_RFC_ABUSE, HTML_40_50, HTML_MESSAGE, SPF_PASS X-Spam-Level: X-Archive-Number: 200610/119 X-Sequence-Number: 15988 ------=_Part_62889_13508428.1161017135623 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline warehouse=# select count(distinct chunk_id) from pg_toast.pg_toast_635216540; count ------- 74557 (1 row) We're on version 8.0.7 On 10/16/06, Tom Lane wrote: > > "Paul Laughlin" 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 ; > > 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 > ------=_Part_62889_13508428.1161017135623 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline warehouse=# select count(distinct chunk_id) from pg_toast.pg_toast_635216540;
count
-------
74557
(1 row)

We're on version 8.0.7

On 10/16/06, Tom Lane <tgl@sss.pgh.pa.us> wrote:
"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

------=_Part_62889_13508428.1161017135623--