Return-Path: mao
Received: by postgres.Berkeley.EDU (5.61/1.29)
	id AA12975; Wed, 29 Jan 92 21:14:53 -0800
Message-Id: <9201300514.AA12975@postgres.Berkeley.EDU>
From: mao@postgres.Berkeley.EDU (Mike Olson)
Subject: Re: table names and formats
To: postgres@postgres.berkeley.edu
Sender: pg_adm@postgres.berkeley.edu
In-Reply-To: Your message of Wed, 29 Jan 92 18:27:07 PST.
             <9201300227.AA11024@postgres.Berkeley.EDU> 
Date: Wed, 29 Jan 92 21:10:25 PST

In message <9201300227.AA11024@postgres.Berkeley.EDU> you write:

> 1. Is there way to retrieve all the class names and attribute names /
>    types that have been created in a given database. ? 

the query

	retrieve (r.relname, a.attname, t.typname)
		from r in pg_class, a in pg_attribute, t in pg_type
		where a.attrelid = r.oid and a.atttypid = t.oid

will do what you want.  it'll do it slowly, but it'll do it.  if you
create a btree index on pg_attribute.attrelid and on pg_type.oid it'll
go faster, but we don't maintain system catalog indices correctly, so
they'll be wrong as soon as you create a new class or type or add an
attribute to an existing class.

> 2. Is there any more documentation on the use of PQfn

documentation on fastpath accesses is pretty skimpy; since i haven't
touched this stuff in more than a year (and have thereby surrendered
responsibility for it), i'll let someone else field this question.

					mike olson
					postgres research group
					uc berkeley
					mao@cs.berkeley.edu
