Re: relid and relname

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Fuhr <mike(at)fuhr(dot)org>
Cc: Edson Vilhena de Carvalho <edson_jvc(at)yahoo(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: relid and relname
Date: 2005-03-25 07:05:43
Message-ID: 20910.1111734343@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Michael Fuhr <mike(at)fuhr(dot)org> writes:
> On Thu, Mar 24, 2005 at 11:01:23PM -0300, Edson Vilhena de Carvalho wrote:
>> Can anyone tell me what is a relid, a relname and
>> schemaname data outputs resulting from the SQL: select
>> * from pg_stat_all_tables;

> relid = object ID (oid) of the relation (table)

More specifically, it's the OID of the pg_class row for the table.
So you can join the relid from that view to pg_class.oid to find
out more about the table.

> In the system catalogs "relation" doesn't always refer to a table,
> but in pg_stat_all_tables it does (pg_stat_all_tables is a view
> that shows only tables).

We really define "relation" as "anything that has a pg_class entry";
this includes tables, indexes, views, composite types, and some other
weirder cases. Some but not all of these objects have associated disk
files.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message GIROIRE Nicolas (COFRAMI) 2005-03-25 14:29:03 Re: sort array optimisation in pl/perl
Previous Message Ben 2005-03-25 06:14:00 Re: 8.0.1 in a non-standard location and tsearch2