Re: Crosstab question - Mailing list pgsql-sql

From Joe Conway
Subject Re: Crosstab question
Date
Msg-id 3F943CCE.5080800@joeconway.com
Whole thread Raw
In response to Crosstab question  (Adam Witney <awitney@sghms.ac.uk>)
List pgsql-sql
Adam Witney wrote:
> The missing values seemed to have been ignored and so the data is being
> shifted to the left and so put in the wrong columns.
> 
> Am I using this function correctly? What is supposed to happen with missing
> values?

Yeah, that's a limitation of the version of crosstab distributed with 
7.3. And (believe it or not) I've actually found cases where that 
behavior is useful. There is another version of crosstab ("hashed" 
crosstab) that treats missing values the way you expect. You can grab a 
copy backported for 7.3 here:  http://www.joeconway.com/
You want the one that says: "contrib/tablefunc backported for PostgreSQL 
7.3.x -- sync'd with CVS HEAD 02-Oct-2003"

HTH,

Joe



pgsql-sql by date:

Previous
From: Ewald Geschwinde
Date:
Subject: Re: [postgres] Deutsche PostgreSQL-Mailingliste unter postgresql.org
Next
From: Josh Berkus
Date:
Subject: Re: Which is faster SQL or PL/PGSQL