Return-Path: owner-postman
Received: from localhost (localhost [127.0.0.1]) by nobozo.CS.Berkeley.EDU (8.6.4/8.6.3) with SMTP id DAA28426 for postgres-dist; Thu, 17 Mar 1994 03:50:27 -0800
Resent-From: POSTGRES mailing list <postman@postgres.Berkeley.EDU>
Resent-Message-Id: <199403171150.DAA28426@nobozo.CS.Berkeley.EDU>
X-Authentication-Warning: nobozo.CS.Berkeley.EDU: Host localhost didn't use HELO protocol
Sender: owner-postman@postgres.Berkeley.EDU
X-Return-Path: owner-postman
Received: from SYSWRK.UCIS.DAL.CA (syswrk.UCIS.Dal.Ca [129.173.2.108]) by nobozo.CS.Berkeley.EDU (8.6.4/8.6.3) with ESMTP id DAA28417 for <postgres@postgres.Berkeley.EDU>; Thu, 17 Mar 1994 03:50:24 -0800
Received: from AC.Dal.Ca by SYSWRK.UCIS.DAL.CA (PMDF V4.2-14 #2545) id
 <01HA2KNUIX0G0031GB@SYSWRK.UCIS.DAL.CA>; Thu, 17 Mar 1994 07:49:55 -0400
Received: from [129.173.5.92] (spare.Dentistry.Dal.Ca) by AC.DAL.CA (PMDF
 V4.2-14 #2545) id <01HA2KNMPCSW0032W5@AC.DAL.CA>; Thu,
 17 Mar 1994 07:49:48 -0400
Date: Thu, 17 Mar 1994 07:53:31 -0600
From: redman@ac.dal.ca (Ed Redman)
Subject: Defining a type
To: postgres@postgres.Berkeley.EDU
Message-id: <01HA2KNNJD1U0032W5@AC.DAL.CA>
Content-transfer-encoding: 7BIT
Resent-To: postgres-dist@postgres.Berkeley.EDU
Resent-Date: Thu, 17 Mar 94 03:50:27 -0800
Resent-XMts: smtp

        I am relatively new to Postgres. I am trying to define a type. I
have a class of Address . I want to create a class person(.....,
person_address = Address). I have tried to create two functions call
Get_Address and Put_Address . Then define type Address(...) but I seem to
get nowhere. Could someone lead me on the right path.

my address class is defined as follows

create Address(Address_id=char[10],
                Address1 = char[25],
                Address2 = char[25],
                Address3 = char[25],
                Pcode = char[7])

This is what I tried to do

define function Add_Address (language = "postquel", returntype = ?(not sure))
        arg is (Address) as "append Address (Address_id = $1,
        Address1 = $2, Address2 = $3, Address3 = $4, Pcode = $5)"

define function Get_Address (language = "postquel" Returntype = Address)
arg is (char) as "retrieve (Address.all) where Address.Address_id = $1"

define type Address( externallength = 92, input=Add_Address, Output =
Get_Address)



Thanks in advance 
Ed Redman
Computer Systems
Dalhousie Dentistry

