Re: generic crosstab ?

From: Joe Conway <mail(at)joeconway(dot)com>
To: David Johnston <polobo(at)yahoo(dot)com>
Cc: 'Andreas' <maps(dot)on(at)gmx(dot)net>, 'Samuel Gendler' <sgendler(at)ideasculptor(dot)com>, pgsql-sql(at)postgresql(dot)org
Subject: Re: generic crosstab ?
Date: 2012-04-24 22:04:21
Message-ID: 4F972365.7070302@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On 04/24/2012 02:42 PM, David Johnston wrote:
> You must specify the output record structure:
>
> SELECT crosstab(text, text) AS ( col1_name col1_type [, colN_name
> colN_type]* )
>
> Whether this relates to the “materialization node” message you are
> receiving I have no idea.

The error is because you are selecting from a set returning function in
the target list rather than the from clause. It should be more like:

SELECT * FROM crosstab(text, text) AS ( col1_name col1_type [, colN_name
> colN_type]* )

HTH,

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-sql by date

  From Date Subject
Next Message Andreas 2012-04-24 22:37:06 Re: generic crosstab ?
Previous Message David Johnston 2012-04-24 21:42:49 Re: generic crosstab ?