Re: Composite Type : pros and cons - Mailing list pgsql-general

From Merlin Moncure
Subject Re: Composite Type : pros and cons
Date
Msg-id CAHyXU0zSC=YONtvM7e1LuT=UEs+FKW33p5RMS22B-7dx8Oz+tw@mail.gmail.com
Whole thread Raw
In response to Composite Type : pros and cons  (Leguevaques Alex <alex.leguevaques@wanadoo.fr>)
List pgsql-general
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

pgsql-general by date:

Previous
From: salah jubeh
Date:
Subject: Re: How to push predicate down
Next
From: David W Noon
Date:
Subject: Re: Let-bindings in SQL statements