From: xchris <lyralyra@fastmail.fm>
To: pgsql-sql@postgresql.org
Subject: Noob question about types and lists
Date: Thu, 06 Oct 2005 12:40:06 +0200
Message-ID: <1128595206.27646.18.camel@lyra> (raw)
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: lyralyra@fastmail.fm
Subject: Re: Noob question about types and lists
In-Reply-To: <1128595206.27646.18.camel@lyra>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox