| From: | Merlin Moncure <mmoncure(at)gmail(dot)com> |
|---|---|
| To: | Mika M Lehtonen <mika(at)digikartta(dot)net> |
| Cc: | pgsql-general(at)postgresql(dot)org |
| Subject: | Re: Is this doable using Postgresql crosstab or some other function? |
| Date: | 2012-04-10 14:43:52 |
| Message-ID: | CAHyXU0x__sxwseSmrndk+ZgMN6=-3hm8bD3MqLyYkSF3iAjtEg@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
On Tue, Apr 10, 2012 at 9:31 AM, Mika M Lehtonen <mika(at)digikartta(dot)net> wrote:
> Merlin,
> thanks for your reply. Semidoable? Let's break this into parts:
> 1) Is it possible to create a view which have dynamic number of colums based
> on the select response?
Mostly no. A hardwired restriction is that a view has a rigidly
defined list of columns with defined types. You can skirt that
restriction a couple of ways -- for example your view could be a
single column text (or xml, or hstore) with the columns you want
encoded into it.
> 2) Is it possible to name view colums based on some data retrieved with
> select statement?
nope -- in fact the point of views is to create a well defined
representation of something which is the opposite of what you are
trying to do.
> My pseudo definition, which was already simplified, could be simlified more.
> Maybe I do that and try crosstab for starters. As I told John, this model is
> one that works fine in one large application using MS SQL-Server. This view
> I am trying to create, is something that the application mentioned doesn't
> include. The model itself has been proven to be all working and extremely
> dynamical.
>
> This is what I discussed with John outside the list, forgive me, I didn't
> notice that, neither did John I guess..
merlin
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Andrew Sullivan | 2012-04-10 15:01:13 | Re: Is this doable using Postgresql crosstab or some other function? |
| Previous Message | Mika M Lehtonen | 2012-04-10 14:31:48 | Re: Is this doable using Postgresql crosstab or some other function? |