]> granicus.if.org Git - postgresql/commit
Support \crosstabview in psql
authorAlvaro Herrera <alvherre@alvh.no-ip.org>
Fri, 8 Apr 2016 23:23:18 +0000 (20:23 -0300)
committerAlvaro Herrera <alvherre@alvh.no-ip.org>
Fri, 8 Apr 2016 23:23:18 +0000 (20:23 -0300)
commitc09b18f21c52cbcf8718d6c267c84fcfea3739a9
tree14ae5d520050d3302c8ecae141a2deda7c17a962
parent279d86afdbed550425bc9d1327ade2dc0028ad33
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
13 files changed:
doc/src/sgml/ref/psql-ref.sgml
src/bin/psql/Makefile
src/bin/psql/command.c
src/bin/psql/common.c
src/bin/psql/crosstabview.c [new file with mode: 0644]
src/bin/psql/crosstabview.h [new file with mode: 0644]
src/bin/psql/help.c
src/bin/psql/settings.h
src/bin/psql/tab-complete.c
src/fe_utils/print.c
src/include/fe_utils/print.h
src/test/regress/expected/psql.out
src/test/regress/sql/psql.sql