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 RAA18332 for postgres-dist; Wed, 23 Mar 1994 17:37:06 -0800
Resent-From: POSTGRES mailing list <postman@postgres.Berkeley.EDU>
Resent-Message-Id: <199403240137.RAA18332@nobozo.CS.Berkeley.EDU>
Sender: owner-postman@postgres.Berkeley.EDU
X-Return-Path: owner-postman
Received: from faerie.CS.Berkeley.EDU (faerie.CS.Berkeley.EDU [128.32.149.14]) by nobozo.CS.Berkeley.EDU (8.6.4/8.6.3) with ESMTP id RAA18323 for <postgres@postgres.Berkeley.EDU>; Wed, 23 Mar 1994 17:37:05 -0800
Received: from localhost (localhost [127.0.0.1]) by faerie.CS.Berkeley.EDU (8.6.4/8.1B) with SMTP id RAA01764; Wed, 23 Mar 1994 17:35:24 -0800
Message-Id: <199403240135.RAA01764@faerie.CS.Berkeley.EDU>
X-Authentication-Warning: faerie.CS.Berkeley.EDU: Host localhost didn't use HELO protocol
From: aoki@postgres.Berkeley.EDU (Paul M. Aoki)
To: redman@ac.dal.ca (Ed Redman)
Cc: postgres@postgres.Berkeley.EDU
Subject: Re: Defining a type 
Reply-To: aoki@postgres.Berkeley.EDU (Paul M. Aoki)
In-reply-to: Your message of Thu, 17 Mar 1994 07:53:31 -0600 
	     <01HA2KNNJD1U0032W5@AC.DAL.CA> 
Date: Wed, 23 Mar 94 17:35:23 -0800
X-Sender: aoki@postgres.Berkeley.EDU
Resent-To: postgres-dist@postgres.Berkeley.EDU
X-Mts: smtp
Resent-Date: Wed, 23 Mar 94 17:37:06 -0800
Resent-XMts: smtp

redman@ac.dal.ca (Ed Redman) writes:
>         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.

"define type" is meant to define a new base type, meaning something
with a C definition and input/output functions written in C.

when you create a new table, a new composite (tuple) type with that 
name is created automatically.  once you define table EMP, you can
immediately define postquel functions that operate on type EMP.
(montage has a cleaner model here in that several tables can be of 
the same composite type.)

the only ways to get attributes of composite types are:
	- use a function as a virtual column
	- use the sets interface
these are documented, at least in the current release.
--
  Paul M. Aoki  |  CS Div., Dept. of EECS, UCB  |  aoki@postgres.Berkeley.EDU
                |  Berkeley, CA 94720           |  ...!uunet!ucbvax!aoki
