Add \pset options for boolean value display

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Add \pset options for boolean value display
Date: 2025-03-21 03:24:46
Message-ID: CAKFQuwYts3vnfQ5AoKhEaKMTNMfJ443MW2kFswKwzn7fiofkrw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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.

Attachment Content-Type Size
v0-0001-Add-pset-options-for-boolean-value-display.patch text/x-patch 4.3 KB

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2025-03-21 03:38:40 Re: Separate GUC for replication origins
Previous Message David Rowley 2025-03-21 02:50:11 Re: Add estimated hit ratio to Memoize in EXPLAIN to explain cost adjustment