On 2025-Oct-21, Álvaro Herrera wrote:
> On 2025-Oct-20, David G. Johnston wrote:
> > Thank you.  Seems good from a quick read.  I’m regretting the choice of the
> > display_ prefix; is there any technical limitation or other opposition to
> > using just true and false?
> > 
> > \pset true ‘true’
> > \pset false ‘false’
> Uhm.  I don't know.  [...]  I'll gladly take a vote.
I got zero votes and lots of digression, so I have pushed with your
original choice of "display_true" and "display_false".  The "true" and
"false" variable names sound too generic and I think they're more likely
to cause confusion.  I think "null" is not a great name either, but it's
been there since forever so I'm not going to propose changing it.
It's always been the case that for machine-readable output, --no-psqlrc
should be used, and a majority of interesting scripts I've seen do that
already, so I don't expect lots of breakage.  (Also, such a script is
easy to fix if anyone runs into trouble.)
I have added this to my stock .psqlrc as dogfooding experiment:
select :VERSION_NUM >= 190000 as bool_display \gset
\if :bool_display
\pset display_true YES
\pset display_false no
\unset bool_display
\endif
This means I get support for it when connecting to older servers with
new psql, and if I use the old psql, things behave normally with no
extra noise.
-- 
Álvaro Herrera               48°01'N 7°57'E  —  https://www.EnterpriseDB.com/