Re: How to determine which file contains which block

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Frank Way <fgw_three(at)yahoo(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: How to determine which file contains which block
Date: 2004-01-28 22:45:16
Message-ID: 7274.1075329916@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Frank Way <fgw_three(at)yahoo(dot)com> 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

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Chris White (cjwhite) 2004-01-29 06:54:34 Re: Error seen when vacuuming pg_largeobject table
Previous Message Gaetano Mendola 2004-01-28 22:15:10 Re: Error seen when vacuuming pg_largeobject table