Re: crosstab

From: Joe Conway <mail(at)joeconway(dot)com>
To: Aram Fingal <fingal(at)multifactorial(dot)com>
Cc: Postgres-General General <pgsql-general(at)postgresql(dot)org>
Subject: Re: crosstab
Date: 2012-09-04 19:26:21
Message-ID: 504655DD.4030701@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 09/04/2012 12:17 PM, Aram Fingal wrote:
> On Sep 4, 2012, at 2:51 PM, Vincent Veyron wrote:
>> see the documentation for Additional Supplied Modules, in your
>> case tablefunc :
>>
>> http://www.postgresql.org/docs/9.1/static/tablefunc.html
>
> I evaluated tablefunc about a year and a half ago and found that it
> was not what I wanted because you have to explicitly list what you
> want the columns to be. In some cases, there will be hundreds of
> columns in the pivoted table. The Reshape library in R can pivot
> tables without you even knowing ahead of time how many columns there
> are going to be.

Sure, but you cannot return that reshaped table to postgres without
specifying the list of columns explicitly. That is because of how
postgres works internally and has nothing to do with whether you are
using crosstab from tablefunc, PL/R, or some hand-coded SQL statement to
build your crosstab.

But certainly if you can do all your work on the reshaped table within
the R environment, PL/R will be easier to use.

Joe

--
Joe Conway
credativ LLC: http://www.credativ.us
Linux, PostgreSQL, and general Open Source
Training, Service, Consulting, & 24x7 Support

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Aram Fingal 2012-09-04 19:48:55 Re: crosstab
Previous Message Aram Fingal 2012-09-04 19:17:36 Re: crosstab