Re: Fix \crosstabview to honor \pset display_true/display_false
Álvaro Herrera <alvherre@kurilemu.de>
From: Álvaro Herrera <alvherre@kurilemu.de>
To: Chao Li <li.evan.chao@gmail.com>
Cc: "David G. Johnston" <david.g.johnston@gmail.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>,
Bruce Momjian <bmomjian@gmail.com>
Date: 2026-06-26T18:07:35Z
Lists: pgsql-hackers
Hello,
On 2026-Jun-26, Chao Li wrote:
> I didn’t take this part from your proposal, so an empty cell still shows nothing:
> ```
> @@ -442,7 +421,7 @@ printCrosstab(const PGresult *result,
> for (i = 0; i < cont.cellsadded; i++)
> {
> if (cont.cells[i] == NULL)
> - cont.cells[i] = "";
> + cont.cells[i] = printDisplayValue(&popt, InvalidOid, NULL, "");
> }
> ```
Yeah, this particular hunk wasn't intended for commit, so leaving it out
was the right thing to do.
> Your proposed test has NULL in the row and column headers, but not in
> the value column. I added a NULL value too, so the test case
> explicitly demonstrates the display difference between a NULL value
> and an empty cell.
Yeah, that's perfect, thanks.
> PFA v4: addressed Álvaro's comments.
Pushed now, thanks.
--
Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/
Commits
-
Make crosstabview honor boolean/null display settings
- 4df5fe3833a8 19 (unreleased) landed