Re: Fwd: PATCH: psql boolean display

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Phil Sorber <phil(at)omniti(dot)com>
Cc: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Fwd: PATCH: psql boolean display
Date: 2012-09-02 15:05:46
Message-ID: 23034.1346598346@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Phil Sorber <phil(at)omniti(dot)com> writes:
> What my patch was intended to do was let the end user set boolean
> output to any arbitrary values. While foo/bar is pretty useless, it
> was meant to reinforce that it was capable of any arbitrary value. I
> can think of a decent list of other output an end user might want,
> such as:

> true/false
> yes/no
> y/n
> on/off
> 1/0
> enabled/disabled

> Plus the different capitalized forms.

I can readily see that people might want boolean columns displayed in
such ways in custom applications. I'm less convinced that there is much
use for it in psql, though. In the big scheme of things, psql is a
rather low-level tool, designed for DBAs and SQL programmers. I'd get
quite upset if psql failed to tell me the truth about what was in a
table I was looking at --- and a feature like this comes pretty close
to not telling the truth, especially if it kicks in on a column I
wasn't expecting it to.

On the whole I think this sort of substitution belongs in a
user-written-application layer of software, not in any of the tools
we supply.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Sergey Koposov 2012-09-02 15:26:24 Re: bitmap scan much slower than index scan, hash_search_with_hash_value
Previous Message Phil Sorber 2012-09-02 14:51:53 Re: Fwd: PATCH: psql boolean display