Re: relid and relname - Mailing list pgsql-general

From Tom Lane
Subject Re: relid and relname
Date
Msg-id 20910.1111734343@sss.pgh.pa.us
Whole thread Raw
In response to Re: relid and relname  (Michael Fuhr <mike@fuhr.org>)
List pgsql-general
Michael Fuhr <mike@fuhr.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

pgsql-general by date:

Previous
From: Ben
Date:
Subject: Re: 8.0.1 in a non-standard location and tsearch2
Next
From: "GIROIRE Nicolas (COFRAMI)"
Date:
Subject: Re: sort array optimisation in pl/perl