Re: psql: add \pset true/false - Mailing list pgsql-hackers

From Matthijs van der Vleuten
Subject Re: psql: add \pset true/false
Date
Msg-id 9F653AC9-A596-45F4-B1FE-3808F2DC7FC9@zr40.nl
Whole thread Raw
In response to Re: psql: add \pset true/false  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: psql: add \pset true/false  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-hackers
On 29 Oct 2015, at 08:50, Robert Haas <<a class="" href="mailto:robertmhaas@gmail.com">robertmhaas@gmail.com</a>>
wrote:<brclass="" /><blockquote class="" type="cite"><br class="" />On Thu, Oct 29, 2015 at 1:32 AM, Marko Tiikkaja
<<aclass="" href="mailto:marko@joh.to">marko@joh.to</a>> wrote:<br class="" /><blockquote class=""
type="cite"><blockquoteclass="" type="cite">2. If you're the sort of person liable to be confused by t/f, you<br
class=""/>probably aren't in the target audience for psql anyway.<br class="" /></blockquote><br class="" />Really?
 Thedifference between t/f is that the vertical squiggle is<br class="" />flipped, THAT'S IT.  Consider:<br class=""
/><brclass="" />t t f f f<br class="" />f t f t f<br class="" /><br class="" />Saying that I'm not target audience for
notbeing able to see WTF is going<br class="" />on above I find offending.<br class="" /></blockquote><br class=""
/>Sorry,no offense intended.  It's really just never happened to me<br class="" />that I've had a problem with this,
andI've been using psql for quite<br class="" />a few years now.  I do agree that if you have a bunch of values in a<br
class=""/>row it's more apt to be confusing than with just one, but they won't<br class="" />normally be as closely
spacedas you have them there, because psql<br class="" />inserts spacing and borders and column headers are usually
morethan<br class="" />one character.</blockquote><br class="" /><div class="">I have had exactly this situation a week
ago.I was testing the output of an algorithm that is supposed to have exactly one true value per input id.</div><div
class=""><brclass="" /></div><div class="">In the first screenshot, psql_true_false_off.png, you see the output of psql
unpatched.Notice how there’s barely any obvious difference between ’t’ and ‘f’. It’s hard to verify that the supposed
outputis correct. There’s also some column with all-false values, I would need to carefully examine all the f and t
charactersto find that.</div><div class=""><br class="" /></div><div class="">In the second screenshot,
psql_true_false_on.png,I applied Marko’s patch and set a colorful emoji character as the display string for true and
false.Now it’s relatively easy to verify that there’s exactly one true value. In addition, it’s hard to miss that the
firstcolumn is always false (for this particular range). I wasn’t looking for that, but this presentation made it
strikinglyobvious. In the first screenshot, it would remain hidden. (Did you notice the two columns there that have all
falsevalues?)</div><div class=""><br class="" /></div><div class="">I’ve been testing Marko’s patch for a few months
now,and I’ve found it helps a lot in recognizing booleans in many contexts.</div><div class=""><br class=""
/></div><divclass=""><img apple-height="yes" apple-inline="yes" apple-width="yes" class="" height="832"
id="D3552283-D39E-4810-8425-B73B5B6136BC"src="cid:CDF92331-5D9B-4473-ABDA-F47E9FAA2330@hitc" width="778" /></div><div
class=""><brclass="" /></div><div class=""><img apple-height="yes" apple-inline="yes" apple-width="yes" class=""
height="832"id="767F0557-0991-4C89-8F97-F9CB1A89D6C7" src="cid:F9813FE9-7841-4D30-BA0B-57D638A44A11@hitc" width="760"
/></div><divclass=""><br class="" /></div> 

pgsql-hackers by date:

Previous
From: Vladimir Borodin
Date:
Subject: Re: [ADMIN] Replication slots and isolation levels
Next
From: Michael Paquier
Date:
Subject: Re: [ADMIN] Replication slots and isolation levels