Re: Question(s) about crosstab - Mailing list pgsql-general

From Scott Marlowe
Subject Re: Question(s) about crosstab
Date
Msg-id CAOR=d=3GxAAR=-2R4gGF1fFiyN8jKMn-F3GrN8_K-7GyVL8pNQ@mail.gmail.com
Whole thread Raw
In response to Re: Question(s) about crosstab  (Ken Tanzer <ken.tanzer@gmail.com>)
List pgsql-general
On Tue, Dec 17, 2013 at 10:42 PM, Ken Tanzer <ken.tanzer@gmail.com> wrote:
>
> On Tue, Dec 17, 2013 at 5:11 PM, David Johnston <polobo@yahoo.com> wrote:
>>
>> 3) Limitation of SQL - explained below:
>>
>> The function call string that you pass in is just that, a string, the SQL
>> construct within which it resides has no knowledge of its contents.
>>
>> SQL has the hard requirement that at the time you submit a query all columns
>> must be known.  If a function is polymorphic (in the sense it can output
>> different columns/row-types) then when you call that function you must
>> indicate which columns (and types) are going to be output by the function
>> during this specific execution.
>
>
> I guess crosstabs were not all that I hoped they were (basically pivot tables), but thanks for the clear explanation.

In the past I've written simple bash, perl, php etc scripts that
interrogated catalogs and then built my crosstab queries for me. You
could do it in a pl language, tho probably not easily in plpgsql.
plpython or plperl etc would proabably be a good place to start.


pgsql-general by date:

Previous
From: Ken Tanzer
Date:
Subject: Re: Question(s) about crosstab
Next
From: Albe Laurenz
Date:
Subject: Re: help replacing expresion in plpgsql