Re: Mapping a Data File Back to a Table

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Greg Schenzel <inittab(at)unixdev(dot)net>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Mapping a Data File Back to a Table
Date: 2013-01-07 16:01:54
Message-ID: 10901.1357574514@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Greg Schenzel <inittab(at)unixdev(dot)net> writes:
> So I've been digging through a database on an embedded device for two
> days trying to figure out which table some data is stored in. There
> are litterally 1000 tables in the database and I haven't come across
> the right one(s) yet. I know that the data I'm looking for is stored
> in /var/lib/pgsql/data/base/16384/2613 from strings and grep. Is there
> any way to map this back to a table or group of tables? Any insight
> would be greatly appreciated!

Just for the record, the 16384 is the OID of a database (look at
pg_database.oid) and 2613 is the filenode of a table (look at
pg_class.relfilenode in the relevant database). contrib/oid2name
can help mechanize this but personally I never bother with that.

See http://www.postgresql.org/docs/9.2/static/storage.html
for the authoritative skinny (but note this stuff does change
across releases, so be sure to read the correct version of the docs).

regards, tom lane

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Armin Resch 2013-01-07 18:17:33 Using pre-configured vs building Postgres
Previous Message Burgholzer, Robert (DEQ) 2013-01-07 13:11:19 Re: restoring from a dump