Re: Fwd: PATCH: psql boolean display

From: Phil Sorber <phil(at)omniti(dot)com>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Fwd: PATCH: psql boolean display
Date: 2012-09-02 14:51:53
Message-ID: CADAkt-hzqFBOUs6JnOJ4Xj1DwUKo_GWLhSy287ye5OXx9+d8HQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Sep 2, 2012 at 1:13 AM, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> wrote:
> ---------- Forwarded message ----------
> From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
> Date: 2012/9/1
> Subject: PATCH: psql boolean display
> To: Phil Sorber <phil(at)omniti(dot)com>
>
>
> Hello
>
> I am looking to your patch:
>
> I have only one note. I don't think so using any text for values
> "true" and "false" is good idea. I don't see a sense of any special
> texts like "foo", "bar" from your example.
>
> More strict design is better - I wrote simple modification - it is
> based on psql psets - and it add new configuration settings "boolstyle
> [char|word]". A advantage of this design is consistency and possible
> autocomplete support.
>
> Regards
>
> Pavel
>
>
>
> postgres=> select true, false;
> bool │ bool
> ──────┼──────
> t │ f
> (1 row)
>
> postgres=> \pset boolstyle word
> Bool output style is word.
> postgres=> select true, false;
> bool │ bool
> ──────┼───────
> true │ false
> (1 row)
>
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
>

What you are proposing sounds like it would be better suited to a
server side GUC. Based on the discussion in the thread that said
true/false was the SQL standard and we were doing it incorrectly as
t/f but could not change for legacy reasons. We could even change the
default but give users a way to revert to the old behavior. Similar to
the bytea_output GUC. Maybe add the GUC for 9.3 but not change the
default behavior until 10.0.

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.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2012-09-02 15:05:46 Re: Fwd: PATCH: psql boolean display
Previous Message Tom Lane 2012-09-02 14:44:29 Re: bitmap scan much slower than index scan, hash_search_with_hash_value