pgsql: Support \crosstabview in psql

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Support \crosstabview in psql
Date: 2016-04-08 23:24:20
Message-ID: E1aoflE-0001Dx-D1@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-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(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Alvaro Herrera 2016-04-09 02:28:55 Re: [COMMITTERS] pgsql: Add the "snapshot too old" feature
Previous Message Kevin Grittner 2016-04-08 22:31:46 Re: pgsql: Add the "snapshot too old" feature