Re: Is this doable using Postgresql crosstab or some other function? - Mailing list pgsql-general

From Merlin Moncure
Subject Re: Is this doable using Postgresql crosstab or some other function?
Date
Msg-id CAHyXU0y7_13yHU=s3hhdfRJ89R5_v4CTukzkQ9NpPHnnmP_cSQ@mail.gmail.com
Whole thread Raw
In response to Re: Is this doable using Postgresql crosstab or some otherfunction?  (<mika@digikartta.net>)
Responses Re: Is this doable using Postgresql crosstab or some other function?
List pgsql-general
On Tue, Apr 10, 2012 at 4:27 AM,  <mika@digikartta.net> wrote:
>
> Let's say I have tens or hundreds or thousands of feature (instance) types.
> Each of them would need its own table.
> Let's say I give for the application administrator, a possibility to create
> new feature types? He/she merely knows what's the database is.
> So I need a model which is capable for offering "dynamic table structures".
>
> I already have implemented parts which allow creating these types, creating
> instances of them and populating those instances with data. Now I have to
> come up with a method for flattening that data into one view so that it can
> be used directly.

If  you want a schemaless design in a relational database, you have a
some options: EAV model, hstore, xml (soon json too) as data.  I
consider these to be niche solutions not well suited to general
purpose data management.  For the most part, SQL really only works
properly with a well defined schema.

Your incoming data looks to be EAV-ish.   You can build horizontal
structures with crosstab and what you're trying to do looks semi
doable, but it's going to to be quite difficult.

merlin

pgsql-general by date:

Previous
From:
Date:
Subject: Re: Is this doable using Postgresql crosstab or some other function?
Next
From: Merlin Moncure
Date:
Subject: Re: Instangram is powered by PostgreSQL