From 6f0d6a507889d94a79c0d18577a0cb1ccc2b6815 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Thu, 14 Apr 2016 22:54:26 -0400 Subject: Rethink \crosstabview's argument parsing logic. \crosstabview interpreted its arguments in an unusual way, including doing case-insensitive matching of unquoted column names, which is surely not the right thing. Rip that out in favor of doing something equivalent to the dequoting/case-folding rules used by other psql commands. To keep it simple, change the syntax so that the optional sort column is specified as a separate argument, instead of the also-quite-unusual syntax that attached it to the colH argument with a colon. Also, rework the error messages to be closer to project style. --- doc/src/sgml/ref/psql-ref.sgml | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml index b2b2adc3b62..41606658825 100644 --- a/doc/src/sgml/ref/psql-ref.sgml +++ b/doc/src/sgml/ref/psql-ref.sgml @@ -993,9 +993,10 @@ testdb=> \crosstabview [ colV - colH[:scolH] - [colD] - ] + [ colH + [ colD + [ sortcolH + ] ] ] ] Executes the current query buffer (like \g) and @@ -1004,16 +1005,11 @@ testdb=> The output column identified by colV becomes a vertical header and the output column identified by colH - becomes a horizontal header, optionally sorted by ranking data obtained - from column scolH. + becomes a horizontal header. colD identifies the output column to display within the grid. - If colD is not - specified and there are exactly three columns in the result set, - the column that is neither - colV nor - colH - is displayed; if there are more columns, an error is reported. + sortcolH identifies + an optional sort column for the horizontal header. @@ -1024,6 +1020,12 @@ testdb=> and colH as column 2. colH must differ from colV. + If colD is not + specified, then there must be exactly three columns in the query + result, and the column that is neither + colV nor + colH + is taken to be colD. @@ -1037,11 +1039,11 @@ testdb=> found in column colH, with duplicates removed. By default, these appear in the same order as in the query results. But if the - optional scolH argument is given, it - identifies a column whose values must be integer numbers, and the + optional sortcolH argument is given, + it identifies a column whose values must be integer numbers, and the values from colH will appear in the horizontal header sorted according to the - corresponding scolH values. + corresponding sortcolH values. -- cgit v1.2.3