From: | xchris <lyralyra(at)fastmail(dot)fm> |
---|---|
To: | pgsql-sql(at)postgresql(dot)org |
Subject: | Noob question about types and lists |
Date: | 2005-10-06 10:40:06 |
Message-ID: | 1128595206.27646.18.camel@lyra |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
Hi,
i'm really new to postgres and have some doubts.
Hope somebody could explain.
Let say i have a table of "clients" and every client has a small number
of addresses. (let say 3)
My approch is to create a type "address" like this (simplified)
CREATE TYPE address AS
(
street VARCHAR(160),
city INTEGER,
cap INTEGER,
country INTEGER (those are referring to other table)
);
and then composing table client
CREATE TABLE client
(
id SERIAL PRIMARY KEY,
name VARCHAR(80),
surname VARCHAR(80),
address address[3]
....
UNIQUE (name,surname)
);
This doesn't work.
I cannot create a list of types.
I'm using a wrong syntax? or simply i cannot do this?
Please forgive me if this is explained somewhere in the doc or in faqs,I
didn't find it.
Thank You
Christian
From | Date | Subject | |
---|---|---|---|
Next Message | Richard Huxton | 2005-10-06 11:20:46 | Re: Noob question about types and lists |
Previous Message | Eugene E. | 2005-10-06 07:11:51 | Re: catching errors in function |