Return-Path: pg_adm@postgres.berkeley.edu
Received: by postgres.Berkeley.EDU (5.61/1.29)
	id AA00580; Wed, 5 Aug 92 19:44:03 -0700
Date: Wed, 5 Aug 92 19:44:03 -0700
Message-Id: <9208060244.AA00580@postgres.Berkeley.EDU>
From: joseash@bush.tamu.edu (Alfredo Sanchez)
Subject: Re: postgres question
To: postgres@postgres.berkeley.edu
Sender: pg_adm@postgres.berkeley.edu

Rex Jakobovits (rex@cs.washington.edu) writes:

> One thing I have not been able to
> figure out is: how do I list the classes and fields defined in a
> database?  Suggestions would be greatly appreciated.
> 

Someone answered this and I've used it now and then, so I repost:
> 
> You can query the system catalogs directly:
> 
> 	retrieve (pg_class.relname)
> 
> 	retrieve (pg_attribute.attname)
> 	where pg_attribute.attrelid = pg_class.oid
> 	and pg_class.relname = "foo"
> 
> The first query gives you all class names in the database and
> the second query gives you all attribute names for class foo
> (this includes both system and user defined attributes).
> 

Regards,

J Alfredo Sanchez H
-------------------
Hypermedia Research Lab
Texas A&M University


