Re: generic crosstab - Mailing list pgsql-general

From Pavel Stehule
Subject Re: generic crosstab
Date
Msg-id 162867790711060614i6a053004w5e8606204301d303@mail.gmail.com
Whole thread Raw
In response to generic crosstab  (Toni Casueps <casueps@hotmail.com>)
List pgsql-general
On 06/11/2007, Toni Casueps <casueps@hotmail.com> wrote:
>
> I'm using the PostgreSQL crosstab functions to do something like this:
>
> From this table ...
>
> a    x     10
> b    x     13
> a    y     11
> b    y     17
>
>
> ... I get:
>
>           x        y
> a        10       11
> b        13       17
>
>
> To get the second table I have to specify the field list when I call the crosstab function (in this example it would
beAS t(x integer, y integer)) 
> My problem arises when that field list changes, for example when someone inserts a record in the first table with a
newvalue, for example "z". In that case I have to change my queries to AS t(x integer, y integer, z integer) 
>
> Do you know how to declare a "generic" field list, or some other library similar to crosstab?
>

Hello

it isn't possible. PostgreSQL'SQL is strict typed language :(.

Pavel Stehule



> _________________________________________________________________
> Express yourself instantly with MSN Messenger! Download today it's FREE!
> http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
> ---------------------------(end of broadcast)---------------------------
> TIP 1: if posting/reading through Usenet, please send an appropriate
>        subscribe-nomail command to majordomo@postgresql.org so that your
>        message can get through to the mailing list cleanly
>

pgsql-general by date:

Previous
From: "Pavel Stehule"
Date:
Subject: Re: Postgresql simple query performance question
Next
From: Reg Me Please
Date:
Subject: Re: Postgresql simple query performance question