]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Make crosstabview honor boolean/null display settings master github/master
authorÁlvaro Herrera <alvherre@kurilemu.de>
Fri, 26 Jun 2026 18:03:42 +0000 (20:03 +0200)
committerÁlvaro Herrera <alvherre@kurilemu.de>
Fri, 26 Jun 2026 18:03:42 +0000 (20:03 +0200)
commit4df5fe3833a87f6629eb888ca5a385bcb0b179d9
tree134d81094ab74c3e957ace271cd22d0934c720f3
parentdac36601fd774a00b3b7390a656a689e2881bcf4
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 <lic@highgo.com>
Reported-by: Chao Li <lic@highgo.com>
Reviewed-by: David G. Johnston <david.g.johnston@gmail.com>
Reviewed-by: Álvaro Herrera <alvherre@kurilemu.de>
Backpatch: none needed
Discussion: https://postgr.es/m/B5E6F0A5-4B48-46D0-B5EB-CF8F8CC7D07D@gmail.com
src/bin/psql/crosstabview.c
src/test/regress/expected/psql_crosstab.out
src/test/regress/sql/psql_crosstab.sql