Re: psql: add \pset true/false

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Matthijs van der Vleuten <matthijs(at)zr40(dot)nl>
Cc: PostgreSQL hackers <pgsql-hackers(at)postgresql(dot)org>, Marko Tiikkaja <marko(at)joh(dot)to>, Robert Haas <robertmhaas(at)gmail(dot)com>
Subject: Re: psql: add \pset true/false
Date: 2015-11-12 19:52:12
Message-ID: CAKFQuwZOvVZGrdyKFT5wA92nM7hxUnq93_WRtBfRq99vjPU3Bw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Oct 29, 2015 at 5:28 AM, Matthijs van der Vleuten <matthijs(at)zr40(dot)nl>
wrote:

> 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.
>

​If this is particularly important I would add something like (and(col1,
col2, col3, ...) = true) and/or NULLIF((not(col1)::int + not(col2)::int
..., 0) to the grid and check/test those instead of visually scanning the
output.

​If the pretty presentation is destined for final output I'd say you really
want to output text and write a function so that the logic is embedded in
the query and not a side-effect of a specific environment.

David J.​

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2015-11-12 19:59:54 pgsql: Move each SLRU's lwlocks to a separate tranche.
Previous Message Tom Lane 2015-11-12 19:41:03 Re: BUG #13741: vacuumdb does not accept valid password