Thread: Trouble with composite types

Trouble with composite types

From
Yasir Malik
Date:
Hello,
I don't know why this message is not going through!

I have the following types:
create type street_type as
(
street_number   smallint,
street_name     text,
apt_number      smallint
);

create type address_type as
(
street          street_type,
city            text,
state           char(2),
zip_code        char(5)
);

When I enter that into the command prompt, I the following message:
ERROR:  Attribute "street" has composite type street_type

Why is it giving me error message for something I know is true?  Also, how
do I add a member function to a type?
Thanks,
Yasir


Re: Trouble with composite types

From
Joe Conway
Date:
Yasir Malik wrote:
[attempts to use a composite type as a field data type of another composite type]
> When I enter that into the command prompt, I the following message:
> ERROR:  Attribute "street" has composite type street_type
> 
> Why is it giving me error message for something I know is true?  Also, how
> do I add a member function to a type?

What you are trying to do is currently unsupported. There have been 
multiple discussions in the past on this -- try searching the archives 
for more info.

Joe