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