Skip site navigation (1) Skip section navigation (2)

Trouble with composite types

From: Yasir Malik <ymalik(at)cs(dot)stevens-tech(dot)edu>
To: PostgreSQL <pgsql-sql(at)postgresql(dot)org>
Subject: Trouble with composite types
Date: 2004-02-29 20:22:01
Message-ID: Pine.NEB.4.58.0402291520050.4735@dab.cs.stevens-tech.edu (view raw or flat)
Thread:
Lists: pgsql-sql
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

Responses

pgsql-sql by date

Next:From: rixderDate: 2004-02-29 20:48:18
Subject: Re: Field list from table
Previous:From: Tom LaneDate: 2004-02-29 15:11:48
Subject: Re: returning a recordset from PLpg/SQL

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group