Received: from localhost (unknown [200.46.204.183]) by developer.postgresql.org (Postfix) with ESMTP id 45B242E0040 for ; Fri, 20 Jun 2008 18:31:47 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 92567-02 for ; Fri, 20 Jun 2008 18:31:40 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.int.journyx.com (mail.journyx.com [66.219.41.227]) by developer.postgresql.org (Postfix) with ESMTP id DD2B42E0037 for ; Fri, 20 Jun 2008 18:31:43 -0300 (ADT) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.int.journyx.com (Postfix) with ESMTP id 1A8743E20EE for ; Fri, 20 Jun 2008 16:31:32 -0500 (CDT) X-Virus-Scanned: amavisd-new at Received: from mail.int.journyx.com ([127.0.0.1]) by localhost (mail.int.journyx.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id cbHPsUFly8oM for ; Fri, 20 Jun 2008 16:31:30 -0500 (CDT) Received: from whitneys (dhcp-100-201.int.journyx.com [192.168.100.201]) by mail.int.journyx.com (Postfix) with ESMTP id 68C833E2102 for ; Fri, 20 Jun 2008 16:31:30 -0500 (CDT) From: "Scott Whitney" To: Subject: Re: Missing chunks from my toast... Date: Fri, 20 Jun 2008 16:34:46 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook, Build 11.0.6353 In-Reply-To: Thread-Index: AcjS9HUwK1f8jxZhR0Ow27IrjzEDaAAAr6nAAAl/8oA= X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 Message-Id: <20080620213130.68C833E2102@mail.int.journyx.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200806/187 X-Sequence-Number: 29525 Well, I was unable to fix this with any reindexing stuff. Rather than use last night's pg_dump, which completed successfully, and lose today's data, however, I did this: a) dump the schema b) dump each individual table minus my bad one c) select all the recs except the bad one c1) I found this by using "select * from attachments limit 1000 offset 0" then incremented until I found the bad rec. :) d) insert the recs manually into the new db Just an FYI for anyone else who runs into this and doesn't want to use a known good backup. -----Original Message----- From: Scott Whitney Sent: Jun 20, 2008 12:08 PM To: pgsql-admin@postgresql.org Subject: RE: [ADMIN] Missing chunks from my toast... Tom, Thanks. Here's the output of what just happened: rt3=# select reltoastrelid::regclass from pg_class where relname = 'attachments'; reltoastrelid --------------------------- pg_toast.pg_toast_8507627 (1 row) rt3=# reindex table pg_toast.pg_toast_8507627; REINDEX rt3=# \q -bash-2.05b$ pg_dump rt3 > /tmp/rt3 pg_dump: ERROR: missing chunk number 0 for toast value 110439697 pg_dump: SQL command to dump the contents of table "attachments" failed: PQendcopy() failed. pg_dump: Error message from server: ERROR: missing chunk number 0 for toast value 110439697 pg_dump: The command was: COPY public.attachments (id, transactionid, parent, messageid, subject, filename, contenttype, contentencoding, content, headers, creator, created) TO stdout; Any way to get this bad boy to backup? -----Original Message----- From: Tom Lane [mailto:tgl@sss.pgh.pa.us] Sent: Jun 20, 2008 11:41 AM To: Scott Whitney Cc: pgsql-admin@postgresql.org Subject: Re: [ADMIN] Missing chunks from my toast... "Scott Whitney" writes: > There goes my breakfast... > pg_dump: ERROR: missing chunk number 0 for toast value 110439697 > pg_dump: SQL command to dump the contents of table "attachments" failed: > PQendcopy() failed. > pg_dump: Error message from server: ERROR: missing chunk number 0 for toast > value 110439697 > pg_dump: The command was: COPY public.attachments (id, transactionid, > parent, messageid, subject, filename, contenttype, contentencoding, content, > headers, creator, created) TO stdout; > I've tried reindexing this table (attachments), to no avail. You forgot the attachments, but did you reindex the table itself, or its toast table? The former cannot fix this, the latter might possibly. Easiest way to get the toast table name is select reltoastrelid::regclass from pg_class where relname = 'mytable'; (if you've got more than one table with the same name, obviously you need to add a condition on schema as well). You'll probably need to be superuser to reindex it. regards, tom lane