Re: Composite Type : pros and cons

From: Merlin Moncure <mmoncure(at)gmail(dot)com>
To: Leguevaques Alex <alex(dot)leguevaques(at)wanadoo(dot)fr>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Composite Type : pros and cons
Date: 2012-01-26 16:16:24
Message-ID: CAHyXU0zSC=YONtvM7e1LuT=UEs+FKW33p5RMS22B-7dx8Oz+tw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Jan 26, 2012 at 3:22 AM, Leguevaques Alex
<alex(dot)leguevaques(at)wanadoo(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message David W Noon 2012-01-26 16:29:17 Re: Let-bindings in SQL statements
Previous Message salah jubeh 2012-01-26 16:13:05 Re: How to push predicate down