X-Original-To: pgsql-admin-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 04BC19FB2DB for ; Thu, 13 Jul 2006 22:47:55 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 00341-07 for ; Thu, 13 Jul 2006 22:47:50 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by postgresql.org (Postfix) with ESMTP id D72149FAE4E for ; Thu, 13 Jul 2006 22:47:50 -0300 (ADT) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.7/8.13.7) with ESMTP id k6E1liPU099970 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 13 Jul 2006 19:47:47 -0600 (MDT) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.6/8.13.6) with ESMTP id k6E1liVt090685; Thu, 13 Jul 2006 19:47:44 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.6/8.13.6/Submit) id k6E1lill090684; Thu, 13 Jul 2006 19:47:44 -0600 (MDT) (envelope-from mfuhr) Date: Thu, 13 Jul 2006 19:47:44 -0600 From: Michael Fuhr To: Benjamin Krajmalnik Cc: pgsql-admin@postgresql.org Subject: Re: Determining object name from filenode Message-ID: <20060714014744.GA90562@winnie.fuhr.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200607/108 X-Sequence-Number: 22354 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