Re: [patch] A \pivot command for psql - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [patch] A \pivot command for psql
Date
Msg-id 19660.1439141871@sss.pgh.pa.us
Whole thread Raw
In response to [patch] A \pivot command for psql  ("Daniel Verite" <daniel@manitou-mail.org>)
Responses Re: [patch] A \pivot command for psql  (Joe Conway <mail@joeconway.com>)
Re: [patch] A \pivot command for psql  ("Daniel Verite" <daniel@manitou-mail.org>)
List pgsql-hackers
"Daniel Verite" <daniel@manitou-mail.org> writes:
> 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

I can see the value of a feature like this, but doing it in psql sure
seems like the wrong place.  It would be unavailable to anything
except interactive use.

Is there a way to implement pivoting as a set-returning function?
        regards, tom lane



pgsql-hackers by date:

Previous
From: "Daniel Verite"
Date:
Subject: [patch] A \pivot command for psql
Next
From: Josh Berkus
Date:
Subject: Re: WIP: SCRAM authentication