Subject: table names and formats

From: [email-masked]
Date: Wed, 29 Jan 92 18:27:07 -0800

I have a couple of questions regarding the POSTGRES

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

   I know that PQfname and PQftype can be used to get the name and
   type of a given class , but how do I get all the class names ?

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

( I am using V3.0 )

Thanks again for your help in advance.

Ed

---

From: [email-masked] (Mike Olson)
Date: Wed, 29 Jan 92 21:10:25 PST

>    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
					[email-masked]