Re: [patch] A \pivot command for psql

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: David Fetter <david(at)fetter(dot)org>
Cc: Daniel Verite <daniel(at)manitou-mail(dot)org>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [patch] A \pivot command for psql
Date: 2015-08-10 07:58:35
Message-ID: CAFj8pRC29KZEtMxyG3_CHd-2wBdFa2hmd68oTY9Bm3Y6NSGZMw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2015-08-10 6:04 GMT+02:00 David Fetter <david(at)fetter(dot)org>:

> On Sun, Aug 09, 2015 at 07:29:40PM +0200, Daniel Verite wrote:
> > Hi,
> >
> > I want to suggest a client-side \pivot command in psql, implemented
> > in the attached patch.
> >
> > \pivot takes the current query in the buffer, execute it and
> > display it pivoted by interpreting the result as:
> >
> > column1 => row in pivoted output
> > column2 => column in pivoted output
> > column3 => value at (row,column) in pivoted ouput
>
> This is really neat work, and thanks for the patch.
>
> This issue in this one as in the crosstab extension is that it's
> available only if you are using some particular piece of extra
> software, in this case the psql client.
>
> I'm working up a proposal to add (UN)PIVOT support to the back-end.
> Would you like to join in on that?
>

PIVOT, UNPIVOT should be preferred solution

Pavel

I can look on implementations in other db

>
> Cheers,
> David.
> --
> David Fetter <david(at)fetter(dot)org> http://fetter.org/
> Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
> Skype: davidfetter XMPP: david(dot)fetter(at)gmail(dot)com
>
> Remember to vote!
> Consider donating to Postgres: http://www.postgresql.org/about/donate
>
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2015-08-10 08:00:38 Re: Commitfest remaining "Needs Review" items
Previous Message Amit Kapila 2015-08-10 07:57:12 Re: Commitfest remaining "Needs Review" items