Composite Type : pros and cons

From: Leguevaques Alex <alex(dot)leguevaques(at)wanadoo(dot)fr>
To: pgsql-general(at)postgresql(dot)org
Subject: Composite Type : pros and cons
Date: 2012-01-26 09:22:16
Message-ID: C44163C0-1EDD-4F6E-BA99-DBD9E4E44DC8@wanadoo.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello,
I'm new to Pg and exploring its advanced functionalities for a project.
I find composite type very interesting, but what are problems/limitations ?
I'd want to create this structure for example:
Phone
Nom du champ
Type
Accès
Clef
Commentaire
typ_tel
integer

type téléphone (liste 25)
tel_pre
varchar(5)

Préfixe international téléphone
tel_num
varchar(14)

tel_ext
varchar(5)

Numéro de poste

and other structures for address and timestamp fields (creation and update timestamps.

Is it a good idea ? Are index, constraints possible/easy on subfields ?

Thank you

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Sebastian Tennant 2012-01-26 11:54:44 Help needed creating a view
Previous Message Adrian Klaver 2012-01-26 00:04:44 Re: Why extract( ... from timestamp ) is not immutable?