Re: Unable to determine what has a particular OID

From: Adrian Klaver <adrian(dot)klaver(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Cc: Andy Dale <andy(dot)dale(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: Unable to determine what has a particular OID
Date: 2010-06-18 14:30:28
Message-ID: 201006180730.29038.adrian.klaver@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Friday 18 June 2010 7:15:48 am Andy Dale wrote:
> On 18 June 2010 16:06, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> > Andy Dale <andy(dot)dale(at)gmail(dot)com> writes:
> > > After looking into the the data directory a particular file/oid is
> > > around
> >
> > 21
> >
> > > GB (the oid has 21 files), this OID can then be found in the pg_class
> >
> > table,
> >
> > > the explanation for the size being that the table has around 12.5
> > > Million rows. During the inspection of the data directory I observed
> > > another OID that is around 8.5GB, but I cannot locate the corresponding
> > > entry in the pg_class table (even after dumping the table into a file
> > > and grep-ing for the OID in question).
> >
> > You should be looking at pg_class.relfilenode, not OID. See
> > http://www.postgresql.org/docs/8.3/static/storage.html
> >
> > regards, tom lane
>
> Ok, but when I have dumped the pg_class table into a file like so:
>
> -[ RECORD 1
> ]--+----------------------------------------------------------------
> relname | pg_type
> relnamespace | 11
> reltype | 71
> relowner | 10
> relam | 0
> relfilenode | 1247
> reltablespace | 0
> relpages | 19
> reltuples | 796
> reltoastrelid | 0
> reltoastidxid | 0
> relhasindex | t
> relisshared | f
> relkind | r
> relnatts | 26
> relchecks | 0
> reltriggers | 0
> relukeys | 0
> relfkeys | 0
> relrefs | 0
> relhasoids | t
> relhaspkey | f
> relhasrules | f
> relhassubclass | f
> relfrozenxid | 379
> relacl | {=r/postgres}
> reloptions |
> -[ RECORD 2
> ]--+----------------------------------------------------------------
> relname | triggered_update_columns
> relnamespace | 11313
> reltype | 11477
> relowner | 10
> relam | 0
> relfilenode | 11476
> reltablespace | 0
> relpages | 0
> reltuples | 0
> reltoastrelid | 0
>
> Grep-ing for the correct oid/filenode (110660 in my case), nothing is
> returned.
>
> Cheers,
>
> Andy

Try:
SELECT oid,* from pg_database ;

I suspect the relfilnode you are looking at is another database in the cluster.

--
Adrian Klaver
adrian(dot)klaver(at)gmail(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2010-06-18 14:37:51 Re: Unable to determine what has a particular OID
Previous Message Andy Dale 2010-06-18 14:15:48 Re: Unable to determine what has a particular OID