Thread: PIVOT tables and crosstab

PIVOT tables and crosstab

From
Simon Windsor
Date:
Hi

Are there any plans to embed crosstab within the main release of
Postgres, rather than as a Contrib component.

Also, are there plans to enhance crosstab along the lines of Oracle 11g
of pivot command?

All the best Simon

--
Simon Windsor
Eml: simon.windsor@cornfield.me.uk
Tel: 01454 617689
Mob: 07590 324560

“There is nothing in the world that some man cannot make a little worse
and sell a little cheaper, and he who considers price only is that man's
lawful prey."


Re: PIVOT tables and crosstab

From
Greg Smith
Date:
Simon Windsor wrote:
> Are there any plans to embed crosstab within the main release of
> Postgres, rather than as a Contrib component.
>
contrib components are within the main release of PostgreSQL as far as
the core project is concerned. Sometimes downstream packagers fail to
include them or break them into a separate, optional package, but
they're nonetheless part of the official source code release.

--
Greg Smith    2ndQuadrant   Baltimore, MD
PostgreSQL Training, Services and Support
greg@2ndQuadrant.com  www.2ndQuadrant.com


Re: PIVOT tables and crosstab

From
Alvaro Herrera
Date:
Simon Windsor wrote:

> Are there any plans to embed crosstab within the main release of
> Postgres, rather than as a Contrib component.
>
> Also, are there plans to enhance crosstab along the lines of Oracle 11g
> of pivot command?

I think the standard spelling of this feature is GROUPING SETS along
with syntactical sugar CUBE and ROLLUP.  There was a patch for this
posted some time ago but it doesn't look like it has moved forward
lately.

Barring GROUPING SETS, it is very unlikely that crosstab or pivot are
going to make it into the core.

--
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

Re: PIVOT tables and crosstab

From
Pavel Stehule
Date:
2009/12/11 Alvaro Herrera <alvherre@commandprompt.com>:
> Simon Windsor wrote:
>
>> Are there any plans to embed crosstab within the main release of
>> Postgres, rather than as a Contrib component.
>>
>> Also, are there plans to enhance crosstab along the lines of Oracle 11g
>> of pivot command?
>
> I think the standard spelling of this feature is GROUPING SETS along
> with syntactical sugar CUBE and ROLLUP.  There was a patch for this
> posted some time ago but it doesn't look like it has moved forward
> lately.
>
> Barring GROUPING SETS, it is very unlikely that crosstab or pivot are
> going to make it into the core.

I plan start to work on GROUPING SETS early. What I know - GROUPING
SETS feature is independent on PIVOT/UNPIVOT feature. Personally I
thing so implementation of PIVOT is simpler than implementation of
GROUPING SETS.

Regards
Pavel Stehule
> --
> Alvaro Herrera                                http://www.CommandPrompt.com/
> PostgreSQL Replication, Consulting, Custom Development, 24x7 support
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

Re: PIVOT tables and crosstab

From
Alvaro Herrera
Date:
Pavel Stehule escribió:
> 2009/12/11 Alvaro Herrera <alvherre@commandprompt.com>:

> > I think the standard spelling of this feature is GROUPING SETS along
> > with syntactical sugar CUBE and ROLLUP.  There was a patch for this
> > posted some time ago but it doesn't look like it has moved forward
> > lately.
> >
> > Barring GROUPING SETS, it is very unlikely that crosstab or pivot are
> > going to make it into the core.
>
> I plan start to work on GROUPING SETS early. What I know - GROUPING
> SETS feature is independent on PIVOT/UNPIVOT feature. Personally I
> thing so implementation of PIVOT is simpler than implementation of
> GROUPING SETS.

Hmm, but PIVOT is not on the standard, is it?  As far as I can tell, the
standard wants one to use CUBE and ROLLUP for this kind of thing (and
the standard says that they are syntactical sugar for GROUPING SETS),
but it's possible that I am misreading what they are supposed to do.

--
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

Re: PIVOT tables and crosstab

From
Pavel Stehule
Date:
2009/12/11 Alvaro Herrera <alvherre@commandprompt.com>:
> Pavel Stehule escribió:
>> 2009/12/11 Alvaro Herrera <alvherre@commandprompt.com>:
>
>> > I think the standard spelling of this feature is GROUPING SETS along
>> > with syntactical sugar CUBE and ROLLUP.  There was a patch for this
>> > posted some time ago but it doesn't look like it has moved forward
>> > lately.
>> >
>> > Barring GROUPING SETS, it is very unlikely that crosstab or pivot are
>> > going to make it into the core.
>>
>> I plan start to work on GROUPING SETS early. What I know - GROUPING
>> SETS feature is independent on PIVOT/UNPIVOT feature. Personally I
>> thing so implementation of PIVOT is simpler than implementation of
>> GROUPING SETS.
>
> Hmm, but PIVOT is not on the standard, is it?  As far as I can tell, the
> standard wants one to use CUBE and ROLLUP for this kind of thing (and
> the standard says that they are syntactical sugar for GROUPING SETS),
> but it's possible that I am misreading what they are supposed to do.

Yes - PIVOT is not in standard now. But it could be in standard. It
isn't replaceable with GROUPING SETS - It is total different.

Pavel


>
> --
> Alvaro Herrera                                http://www.CommandPrompt.com/
> PostgreSQL Replication, Consulting, Custom Development, 24x7 support
>