Determining object name from filenode

Lists: pgsql-admin
From: "Benjamin Krajmalnik" <kraj(at)illumen(dot)com>
To: <pgsql-admin(at)postgresql(dot)org>
Subject: Determining object name from filenode
Date: 2006-07-14 00:01:34
Message-ID: BF337097BDD9D849A2F4B818DDB27987029446@stash.stackdump.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-admin

Is there a way to determine the name of an object based on the filenode
number?


From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Benjamin Krajmalnik <kraj(at)illumen(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Determining object name from filenode
Date: 2006-07-14 01:47:44
Message-ID: 20060714014744.GA90562@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-admin

On Thu, Jul 13, 2006 at 06:01:34PM -0600, Benjamin Krajmalnik wrote:
> Is there a way to determine the name of an object based on the filenode
> number?

Use contrib/oid2name or make queries using pg_database.oid and
pg_class.relfilenode. For example, suppose you have the file
$PGDATA/base/16388/640244:

oid2name | grep 16388
oid2name -d dbname -f 640244

or

SELECT datname FROM pg_database WHERE oid = 16388;
\c dbname
SELECT relname FROM pg_class WHERE relfilenode = 640244;

--
Michael Fuhr