X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 595CDD1C9FD for ; Wed, 28 Jan 2004 22:45:46 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 40131-03 for ; Wed, 28 Jan 2004 18:45:17 -0400 (AST) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 3A2BFD1CCCF for ; Wed, 28 Jan 2004 18:45:14 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.11/8.12.11) with ESMTP id i0SMjGS8007275; Wed, 28 Jan 2004 17:45:16 -0500 (EST) To: Frank Way Cc: pgsql-admin@postgresql.org Subject: Re: How to determine which file contains which block In-reply-to: <20040128213722.6828.qmail@web11610.mail.yahoo.com> References: <20040128213722.6828.qmail@web11610.mail.yahoo.com> Comments: In-reply-to Frank Way message dated "Wed, 28 Jan 2004 13:37:22 -0800" Date: Wed, 28 Jan 2004 17:45:16 -0500 Message-ID: <7274.1075329916@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200401/262 X-Sequence-Number: 12125 Frank Way writes: > After finding the ctid in (block,tuple) format, how do you know which > file in all the subdirectories under /usr/local/pgsql/data/base > contains that block? The subdirectories are named after the OIDs of their databases (pg_database.oid column). Individual files are named after the relfilenodes of their tables/indexes (pg_class.relfilenode). Note also that tables exceeding 1GB will be broken into gigabyte-size segments named nnn, nnn.1, nnn.2, etc; if you are dealing with one of these then you need to determine which segment to use from the block number. regards, tom lane