Received: from localhost (unknown [200.46.204.184]) by developer.postgresql.org (Postfix) with ESMTP id 489BE2E002E for ; Tue, 15 Apr 2008 11:44:12 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 53871-05 for ; Tue, 15 Apr 2008 11:43:51 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by developer.postgresql.org (Postfix) with ESMTP id C29E02E004D for ; Tue, 15 Apr 2008 11:44:00 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id m3FEhveS013348; Tue, 15 Apr 2008 10:43:57 -0400 (EDT) To: lfedden@contextworld.com cc: pgsql-admin@postgresql.org Subject: Re: OID and filesystem issues In-reply-to: <4F9161CEA8.07DC005BTFSFDCZG@contextworld.com> References: <4F9161CEA8.07DC005BTFSFDCZG@contextworld.com> Comments: In-reply-to lfedden@contextworld.com message dated "Tue, 15 Apr 2008 10:00:26 +0100" Date: Tue, 15 Apr 2008 10:43:56 -0400 Message-ID: <13347.1208270636@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200804/146 X-Sequence-Number: 28910 lfedden@contextworld.com writes: > 1) Does every relation exist in pg_class? Can we assume that if there is a file with OID which is not present in pg_class, this file can be deleted? (we have a few such files, some of them take more than 2G of space in total) You do know it's relfilenode that counts, not OID? As long as you are paying attention to the right column, yes, you could remove any file that doesn't correspond to a live pg_class row. It's not a common situation though so I'd definitely triple-check first. > 3) We have a relation which is unaccessible (permission denied), ls -l also prints this message so it's something with filesystem. What would be the best procedure to solve this issue ? Fix the ownership/permissions with chown/chmod, as needed. Pretty much all files in a database should be alike in this regard (postgres-owned, mode 0600). regards, tom lane