From josh@4dmatrix.com Fri Mar 28 02:46:27 2003 X-Original-To: pgsql-admin@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 0848347631A for ; Thu, 27 Mar 2003 21:46:27 -0500 (EST) Received: from mail.4dmatrix.com (unknown [208.248.151.248]) by postgresql.org (Postfix) with ESMTP id 36B2E4762F1 for ; Thu, 27 Mar 2003 21:46:22 -0500 (EST) Received: from joshdesk2 (sonicwall.4dmatrix.com [208.248.151.201] (may be forged)) by mail.4dmatrix.com (8.9.3/8.9.3) with SMTP id SAA25417 for ; Thu, 27 Mar 2003 18:43:34 -0800 Message-ID: <04c601c2f4d4$16f90da0$6e02a8c0@4dmatrix.com> From: "Josh Goldberg" To: "postgres-admin" Subject: lost tables Date: Thu, 27 Mar 2003 18:45:27 -0800 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_04C3_01C2F491.08AFA800" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-Spam-Status: No, hits=-0.8 required=5.0 tests=BAYES_30,HTML_30_40,HTML_WITH_BGCOLOR version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200303/474 X-Sequence-Number: 8114 This is a multi-part message in MIME format. ------=_NextPart_000_04C3_01C2F491.08AFA800 Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: quoted-printable I moved a few frequently used tables to a separate drive/partition with a s= ymlink to my real data dir. Thank you Murphy, my other drive died yesterda= y and I hadn't been making backups of those tables. Now I have my db back = up and running but those tables are hosed. I can't drop them using DROP TA= BLE, and I can't do a pg_dump anymore either. everything complains about p= g_toast_xxxxxxxxxx where xxxxxxxx is the filename of the table. How do I c= lean this up so I can rebuild the tables? thanks in advance, Josh Goldberg ------=_NextPart_000_04C3_01C2F491.08AFA800 Content-Type: text/html; charset="iso-2022-jp" Content-Transfer-Encoding: quoted-printable
I moved a few frequently used tables to a = separate=20 drive/partition with a symlink to my real data dir.  Thank you Murphy,= my=20 other drive died yesterday and I hadn't been making backups of those=20 tables.  Now I have my db back up and running but those tables are=20 hosed.  I can't drop them using DROP TABLE, and I can't do a pg_dump= =20 anymore either.  everything complains about pg_toast_xxxxxxxxxx where= =20 xxxxxxxx is the filename of the table.  How do I clean this up so I ca= n=20 rebuild the tables?
 
thanks in advance,
 
Josh Goldberg
------=_NextPart_000_04C3_01C2F491.08AFA800-- From josh@4dmatrix.com Mon Mar 31 20:24:18 2003 X-Original-To: pgsql-admin@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id C0201475AA9 for ; Mon, 31 Mar 2003 15:24:18 -0500 (EST) Received: from mail.4dmatrix.com (mail.4dmatrix.com [208.248.151.248]) by postgresql.org (Postfix) with ESMTP id C5A5947580B for ; Mon, 31 Mar 2003 15:24:17 -0500 (EST) Received: from joshdesk2 (sonicwall.4dmatrix.com [208.248.151.201] (may be forged)) by mail.4dmatrix.com (8.9.3/8.9.3) with SMTP id MAA14199; Mon, 31 Mar 2003 12:21:07 -0800 Message-ID: <069801c2f7c3$5e33c650$6e02a8c0@4dmatrix.com> From: "Josh Goldberg" To: "Josh Goldberg" , "postgres-admin" References: <04c601c2f4d4$16f90da0$6e02a8c0@4dmatrix.com> Subject: Re: lost tables Date: Mon, 31 Mar 2003 12:23:18 -0800 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0695_01C2F780.4FE816C0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-Spam-Status: No, hits=-7.6 required=5.0 tests=BAYES_30,HTML_40_50,HTML_WITH_BGCOLOR,REFERENCES autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200303/513 X-Sequence-Number: 8153 This is a multi-part message in MIME format. ------=_NextPart_000_0695_01C2F780.4FE816C0 Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: quoted-printable bueller? ----- Original Message -----=20 From: Josh Goldberg=20 To: postgres-admin=20 Sent: Thursday, March 27, 2003 6:45 PM Subject: [ADMIN] lost tables I moved a few frequently used tables to a separate drive/partition with a= symlink to my real data dir. Thank you Murphy, my other drive died yester= day and I hadn't been making backups of those tables. Now I have my db bac= k up and running but those tables are hosed. I can't drop them using DROP = TABLE, and I can't do a pg_dump anymore either. everything complains about= pg_toast_xxxxxxxxxx where xxxxxxxx is the filename of the table. How do I= clean this up so I can rebuild the tables? thanks in advance, Josh Goldberg ------=_NextPart_000_0695_01C2F780.4FE816C0 Content-Type: text/html; charset="iso-2022-jp" Content-Transfer-Encoding: quoted-printable
bueller?
----- Original Message -----
Fro= m:=20 Josh Goldb= erg=20
Sent: Thursday, March 27, 2003 6:4= 5=20 PM
Subject: [ADMIN] lost tables

I moved a few frequently used tables to = a=20 separate drive/partition with a symlink to my real data dir.  Thank = you=20 Murphy, my other drive died yesterday and I hadn't been making backups of= =20 those tables.  Now I have my db back up and running but those tables= are=20 hosed.  I can't drop them using DROP TABLE, and I can't do a pg_dump= =20 anymore either.  everything complains about pg_toast_xxxxxxxxxx wher= e=20 xxxxxxxx is the filename of the table.  How do I clean this up so I = can=20 rebuild the tables?
 
thanks in advance,
 
Josh=20 Goldberg
------=_NextPart_000_0695_01C2F780.4FE816C0-- From tgl@sss.pgh.pa.us Tue Apr 1 03:43:10 2003 X-Original-To: pgsql-admin@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id AB91A475AF8 for ; Mon, 31 Mar 2003 22:43:10 -0500 (EST) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id E5DD847580B for ; Mon, 31 Mar 2003 22:43:01 -0500 (EST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.9/8.12.9) with ESMTP id h313gj2L027718; Mon, 31 Mar 2003 22:42:45 -0500 (EST) To: "Josh Goldberg" Cc: "postgres-admin" Subject: Re: lost tables In-reply-to: <069801c2f7c3$5e33c650$6e02a8c0@4dmatrix.com> References: <04c601c2f4d4$16f90da0$6e02a8c0@4dmatrix.com> <069801c2f7c3$5e33c650$6e02a8c0@4dmatrix.com> Comments: In-reply-to "Josh Goldberg" message dated "Mon, 31 Mar 2003 12:23:18 -0800" Date: Mon, 31 Mar 2003 22:42:44 -0500 Message-ID: <27717.1049168564@sss.pgh.pa.us> From: Tom Lane X-Spam-Status: No, hits=-29.3 required=5.0 tests=BAYES_01,EMAIL_ATTRIBUTION,IN_REP_TO,REFERENCES, REPLY_WITH_QUOTES autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200303/515 X-Sequence-Number: 8155 "Josh Goldberg" writes: > I moved a few frequently used tables to a separate drive/partition with a= > symlink to my real data dir. Thank you Murphy, my other drive died yester= > day and I hadn't been making backups of those tables. Now I have my db bac= > k up and running but those tables are hosed. I can't drop them using DROP = > TABLE, and I can't do a pg_dump anymore either. everything complains about= > pg_toast_xxxxxxxxxx where xxxxxxxx is the filename of the table. How do I= > clean this up so I can rebuild the tables? Can't tell without more details. What's the *exact* error message you get from a DROP TABLE? Also it'd be useful to see the pg_class rows for the problem tables ("select oid,* from pg_class where relname = 'xxx'") regards, tom lane From josh@4dmatrix.com Tue Apr 1 19:37:23 2003 X-Original-To: pgsql-admin@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 0CEFF47621C for ; Tue, 1 Apr 2003 14:37:23 -0500 (EST) Received: from mail.4dmatrix.com (mail.4dmatrix.com [208.248.151.248]) by postgresql.org (Postfix) with ESMTP id 16A69475FD9 for ; Tue, 1 Apr 2003 14:37:18 -0500 (EST) Received: from joshdesk2 (sonicwall.4dmatrix.com [208.248.151.201] (may be forged)) by mail.4dmatrix.com (8.9.3/8.9.3) with SMTP id LAA32232; Tue, 1 Apr 2003 11:33:56 -0800 Message-ID: <072901c2f885$f3895e00$6e02a8c0@4dmatrix.com> From: "Josh Goldberg" To: "Tom Lane" Cc: "postgres-admin" References: <04c601c2f4d4$16f90da0$6e02a8c0@4dmatrix.com> <069801c2f7c3$5e33c650$6e02a8c0@4dmatrix.com> <27717.1049168564@sss.pgh.pa.us> Subject: Re: lost tables Date: Tue, 1 Apr 2003 11:36:11 -0800 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-Spam-Status: No, hits=-19.1 required=5.0 tests=BAYES_20,ORIGINAL_MESSAGE,QUOTED_EMAIL_TEXT,REFERENCES autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200304/11 X-Sequence-Number: 8166 thanks for the reply. There are a few tables I did this to, here's one of them: cms3=# select oid,* from pg_class where relname='view_log'; oid | relname | reltype | relowner | relam | relfilenode | relpages | reltuples | reltoastrelid | reltoastidxid | relhasindex | relisshared | relkind | relnatts | relchecks | reltriggers | relukeys | relfkeys | relrefs | relhasoids | relhaspkey | relhasrules | relhassubclass | relacl -------+----------+---------+----------+-------+-------------+----------+--- --------+---------------+---------------+-------------+-------------+------- --+----------+-----------+-------------+----------+----------+---------+---- --------+------------+-------------+----------------+---------------------- 19433 | view_log | 19434 | 1 | 0 | 19433 | 10 | 1000 | 836121 | 0 | t | f | r | 5 | 0 | 0 | 0 | 0 | 0 | t | t | f | t | {=,postgres=arwdRxt} (1 row) cms3=# drop table view_log; NOTICE: RelationBuildDesc: can't open view_log: No such file or directory ERROR: cannot open view_log: No such file or directory cms3=# ----- Original Message ----- From: "Tom Lane" > > Can't tell without more details. What's the *exact* error message you > get from a DROP TABLE? Also it'd be useful to see the pg_class rows > for the problem tables ("select oid,* from pg_class where relname = 'xxx'") From tgl@sss.pgh.pa.us Tue Apr 1 19:54:20 2003 X-Original-To: pgsql-admin@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 6713D475FD9 for ; Tue, 1 Apr 2003 14:54:20 -0500 (EST) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id B1E4B475F26 for ; Tue, 1 Apr 2003 14:54:19 -0500 (EST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.9/8.12.9) with ESMTP id h31JsI2L002683; Tue, 1 Apr 2003 14:54:18 -0500 (EST) To: "Josh Goldberg" Cc: "postgres-admin" Subject: Re: lost tables In-reply-to: <072901c2f885$f3895e00$6e02a8c0@4dmatrix.com> References: <04c601c2f4d4$16f90da0$6e02a8c0@4dmatrix.com> <069801c2f7c3$5e33c650$6e02a8c0@4dmatrix.com> <27717.1049168564@sss.pgh.pa.us> <072901c2f885$f3895e00$6e02a8c0@4dmatrix.com> Comments: In-reply-to "Josh Goldberg" message dated "Tue, 01 Apr 2003 11:36:11 -0800" Date: Tue, 01 Apr 2003 14:54:18 -0500 Message-ID: <2682.1049226858@sss.pgh.pa.us> From: Tom Lane X-Spam-Status: No, hits=-29.3 required=5.0 tests=BAYES_01,EMAIL_ATTRIBUTION,IN_REP_TO,REFERENCES, REPLY_WITH_QUOTES autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200304/13 X-Sequence-Number: 8168 "Josh Goldberg" writes: > cms3=# drop table view_log; > NOTICE: RelationBuildDesc: can't open view_log: No such file or directory > ERROR: cannot open view_log: No such file or directory You should be able to get to a state where you can drop the table by doing touch $PGDATA/base/dbnumber/filenumber where filenumber is the pg_class.relfilenode entry for the table (19433 here), and dbnumber is the pg_database.oid entry for the database. If there is still a symlink in that position, either remove it and do the touch to make a plain file, or do a touch where the symlink points instead. You may need to repeat for each index used by the table, if you moved those off too. BTW, recent versions (7.3 at least, and I think 7.2) will allow a DROP TABLE without insisting on finding an underlying file, for example: regression=# create table z(f1 int); CREATE TABLE regression=# select relfilenode from pg_class where relname = 'z'; relfilenode ------------- 2204132 (1 row) -- as postgres, rm the file 2204132 regression=# drop table z; WARNING: cannot unlink 2066720/2204132: No such file or directory DROP TABLE regards, tom lane