On Thu, Jan 26, 2012 at 3:22 AM, Leguevaques Alex
<alex.leguevaques@wanadoo.fr> wrote:
>
> 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:
Composite types add a little value in that you can apply frequently
grouped together fields in a table. This can save a little typing.
The downside is you are diverging from classic sql mechanics a little
bit which can make some things awkward.
Where they really shine though is as variables if you are doing a lot
of backend programming with functions. You can pass them too and from
functions and make arrays out of them...this is very powerful once you
get the hang of it.
If you are using a client stack that understands postgres composite
types, you can (ab)use this to send complicated datasets to and from
the database.
merlin