pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: pgsql-committers@postgresql.org
Subject: pgsql: Support \crosstabview in psql
Date: Fri, 08 Apr 2016 23:24:20 +0000
Message-ID: <E1aoflE-0001Dx-D1@gemulon.postgresql.org> (raw)
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>

Support \crosstabview in psql

\crosstabview is a completely different way to display results from a
query: instead of a vertical display of rows, the data values are placed
in a grid where the column and row headers come from the data itself,
similar to a spreadsheet.

The sort order of the horizontal header can be specified by using
another column in the query, and the vertical header determines its
ordering from the order in which they appear in the query.

This only allows displaying a single value in each cell.  If more than
one value correspond to the same cell, an error is thrown.  Merging of
values can be done in the query itself, if necessary.  This may be
revisited in the future.

Author: Daniel Verité
Reviewed-by: Pavel Stehule, Dean Rasheed

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/c09b18f21c52cbcf8718d6c267c84fcfea3739a9

Modified Files
--------------
doc/src/sgml/ref/psql-ref.sgml     | 141 ++++++
src/bin/psql/Makefile              |   2 +-
src/bin/psql/command.c             |  15 +
src/bin/psql/common.c              |  26 +-
src/bin/psql/crosstabview.c        | 878 +++++++++++++++++++++++++++++++++++++
src/bin/psql/crosstabview.h        |  26 ++
src/bin/psql/help.c                |   1 +
src/bin/psql/settings.h            |   4 +
src/bin/psql/tab-complete.c        |   3 +-
src/fe_utils/print.c               |  50 ++-
src/include/fe_utils/print.h       |   2 +
src/test/regress/expected/psql.out | 189 ++++++++
src/test/regress/sql/psql.sql      | 105 +++++
13 files changed, 1415 insertions(+), 27 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


Message-ID: <E1aoflE-0001Dx-D1@gemulon.postgresql.org>
Permalink:  ../E1aoflE-0001Dx-D1@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1aoflE-0001Dx-D1@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: alvherre@alvh.no-ip.org
  Subject: Re: pgsql: Support \crosstabview in psql
  In-Reply-To: <E1aoflE-0001Dx-D1@gemulon.postgresql.org>
  References: <E1aoflE-0001Dx-D1@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox