Add \pset options for boolean value display

David G. Johnston <david.g.johnston@gmail.com>

From: "David G. Johnston" <david.g.johnston@gmail.com>
To: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2025-03-21T03:24:46Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Add \pset options for boolean value display

Attachments

Hi!

Please accept this patch (though it's not finished, just functional)!

It's \pset null for boolean values

Printing tables of 't' and 'f' makes for painful-to-read output.
This provides an easy win for psql users, giving them the option to do
better.  I would like all of our documentation examples eventually to be
done with "\pset display_true true" and "\pset display_false false"
configured.  Getting it into v18 so docs being written now, like my NULL
patch, can make use of it, would make my year.

I was initially going to go with the following to mirror null even more
closely.

\pset { true | false } value

And still like that option, though having the same word repeated as the
expected value and name hurts it a bit.

This next one was also considered but the word "print" already seemed a bit
too entwined with \pset format related stuff.

\pset { print_true | print_false } value

David J.