Re: Getting table metadata

From: ntinos(at)aueb(dot)gr
To: "Dann Corbit" <DCorbit(at)connx(dot)com>
Cc: "Ken Tozier" <kentozier(at)comcast(dot)net>, "PostgreSQL" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Getting table metadata
Date: 2005-01-19 08:28:55
Message-ID: courier.41EE1A47.00001D9C@red.servers.aueb.gr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

>
> SELECT * FROM pg_attribute WHERE attrelid=<the table oid>;
>
> The problem I'm running into however, is that given a table name, there
> doesn't seem to be any way to get the table oid. Is there some function
> or query that does this?

I think a way to get the table oid is:

select oid from pg_class where relname=<table_name>

Ntinos Katsaros

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Dann Corbit 2005-01-19 08:46:06 Re: Getting table metadata
Previous Message Thomas F.O'Connell 2005-01-19 07:46:33 Re: PL/PgSQL Index Usage with Trigger Variables