generic crosstab - Mailing list pgsql-general

From Toni Casueps
Subject generic crosstab
Date
Msg-id BLU109-W4705AF36D8BB4966D60BBFAD890@phx.gbl
Whole thread Raw
Responses Re: generic crosstab  (Reg Me Please <regmeplease@gmail.com>)
Re: generic crosstab  ("Pavel Stehule" <pavel.stehule@gmail.com>)
List pgsql-general
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 be
ASt(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 new
value,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?

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/

pgsql-general by date:

Previous
From: "Hristo Filipov"
Date:
Subject: Re: How to transfer from place to plase without backup/restore
Next
From: Reg Me Please
Date:
Subject: Re: generic crosstab