Re: Fix \crosstabview to honor \pset display_true/display_false

Álvaro Herrera <alvherre@kurilemu.de>

From: Álvaro Herrera <alvherre@kurilemu.de>
To: "David G. Johnston" <david.g.johnston@gmail.com>
Cc: Chao Li <li.evan.chao@gmail.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>, Bruce Momjian <bmomjian@gmail.com>
Date: 2026-06-19T17:24:31Z
Lists: pgsql-hackers

Attachments

On 2026-Jun-19, David G. Johnston wrote:

> Looked a bit closer at printQuery this time; disliking that the if
> condition has an awareness of the implementation of
> printQueryOptDisplayValue since it lists !isnull and ftype != BOOLOID
> explicitly.
> 
> How about not touching print.c at all with this patch, moving the
> printQueryOptDisplayValue into crosstabview.c and leaving printQuery alone
> since it is already correct?

That was my reaction also, so I produced this POC patch.  I think
print.h needs some more work, and that'd be only for 20.

-- 
Álvaro Herrera               48°01'N 7°57'E  —  https://www.EnterpriseDB.com/
"La libertad es como el dinero; el que no la sabe emplear la pierde" (Alvarez)

Commits

  1. Make crosstabview honor boolean/null display settings