Make crosstabview honor boolean/null display settings psql's \pset display_true/false settings, added by commit 645cb44c5490, affect normal query output, but not \crosstabview. As a result, boolean values used anywhere in crosstab output were always shown as "t" or "f", which is inconsistent. Change \crosstabview so that the configured values are displayed instead.
While at it, make \crosstabview print the \pset null string, if any, in cells for which the query produces a NULL value. Cells for which the query produces no value continue to have the empty string. This is an oversight in the aboriginal \crosstabview commit, c09b18f21c52. Add a regression test covering all of this. Author: Chao Li <[email protected]> Reported-by: Chao Li <[email protected]> Reviewed-by: David G. Johnston <[email protected]> Reviewed-by: Álvaro Herrera <[email protected]> Backpatch: none needed Discussion: https://postgr.es/m/[email protected] Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/4df5fe3833a87f6629eb888ca5a385bcb0b179d9 Modified Files -------------- src/bin/psql/crosstabview.c | 59 +++++++++++++++++++++-------- src/test/regress/expected/psql_crosstab.out | 29 ++++++++++++++ src/test/regress/sql/psql_crosstab.sql | 24 ++++++++++++ 3 files changed, 96 insertions(+), 16 deletions(-)
