Subject: some help with postgres

From: Carolyn Giberson <[email-masked]>
Date: Thu, 11 Jul 91 13:15:12 -0700

I'm just learning POSTGRES, and am having trouble with POSTQUEL functions.
Here is what I've done:
1.  created a query file named pq.2 in vi as follows -
    define postquel function middleaged(emp) returns emp is
    retrieve(emp.all) where emp.age > 35
2.  the emp relation has the structure (name = char16, id = int4,
    city = char16, age = int4)
3.  loaded the query into the workspace as follows:
    \i <path>/pq.2
    \g to evaluate query

    an attribute named "middleaged" was added to emp.  should it have been?

4.  invoked the function with:
    retrieve(e.name, e.age) from e in emp where middleaged.emp \g

The results returned give the names and ages of everyone in the relation,
even a person whose age = 30.  I'm obviously doing something wrong.
Can you spot what it is?

Also, are there commands to:
1.  list all of the relations in a database
2.  list the structure of a database

Thanks for your help.  I'm enjoying learning about POSTGRES.

				Carolyn B. Giberson
				University of Georgia

---

From: [email-masked] (Greg Kemnitz)
Date: Thu, 11 Jul 91 13:24:26 -0700

As documented in the release notes and bug lists (available on Postgres
in pub/postgres-v2r1.bugs), Postquel functions don't work well in 2.1.
They should not be used until 3.0 comes out.

	Greg Kemnitz
	[email-masked]