Return-Path: pg_adm@postgres.berkeley.edu
Received: by postgres.Berkeley.EDU (5.61/1.29)
	id AA15123; Thu, 11 Jul 91 13:15:12 -0700
Date: Thu, 11 Jul 91 13:15:12 -0700
Message-Id: <9107112015.AA15123@postgres.Berkeley.EDU>
From: Carolyn Giberson <giber@pollux.cs.uga.edu>
Subject: some help with postgres
To: postgres@postgres.berkeley.edu
Cc: giber@pollux.cs.uga.edu

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
