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

From David G. Johnston
Subject Re: psql: add \pset true/false
Date
Msg-id CAKFQuwZOvVZGrdyKFT5wA92nM7hxUnq93_WRtBfRq99vjPU3Bw@mail.gmail.com
Whole thread Raw
In response to Re: psql: add \pset true/false  (Matthijs van der Vleuten <matthijs@zr40.nl>)
List pgsql-hackers
On Thu, Oct 29, 2015 at 5:28 AM, Matthijs van der Vleuten <matthijs@zr40.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.​


pgsql-hackers by date:

Previous
From: "Daniel Verite"
Date:
Subject: Re: psql: add \pset true/false
Next
From: Robert Haas
Date:
Subject: Re: [PATCH] Refactoring of LWLock tranches