agora inbox for postgres@postgres.berkeley.edu  
help / color / mirror / Atom feed
From: Alfredo Sanchez <joseash@bush.tamu.edu>
To: postgres@postgres.berkeley.edu
Subject: Re: postgres question
Date: Wed, 5 Aug 92 19:44:03 -0700
Message-ID: <9208060244.AA00580@postgres.Berkeley.EDU> (raw)

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





reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: postgres@postgres.berkeley.edu
  Cc: joseash@bush.tamu.edu
  Subject: Re: postgres question
  In-Reply-To: <9208060244.AA00580@postgres.Berkeley.EDU>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox