Re: PATCH: psql boolean display - Mailing list pgsql-hackers

From Tom Lane
Subject Re: PATCH: psql boolean display
Date
Msg-id 12113.1345504743@sss.pgh.pa.us
Whole thread Raw
In response to Re: PATCH: psql boolean display  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Responses Re: PATCH: psql boolean display
Re: PATCH: psql boolean display
List pgsql-hackers
"Kevin Grittner" <Kevin.Grittner@wicourts.gov> writes:
> The type itself does output true/false; it's just psql that uses
> t/f.

No, 't'/'f' is what boolout() returns.  The 'true'/'false' results from
casting bool to text are intentionally different --- IIRC, Peter E.
argued successfully that this cast behavior is required by SQL spec.
But we'd already been returning 't'/'f' to applications for far too many
years to change it.  (And that argument has not gotten any weaker since
then.  Keep in mind that Postgres was returning 't'/'f' for bool years
before the SQL spec even had a boolean type.)

If we're going to do something like this at all, I agree that psql is
the place to do it, not the server.  But my beef with this patch is that
it's thinking too small --- why would bool be the only type that
somebody would want to editorialize on the display of?  I'd rather see
some general "substitute this for that in display of columns of type X"
feature.
        regards, tom lane



pgsql-hackers by date:

Previous
From: "David Johnston"
Date:
Subject: Re: temporal support patch
Next
From: Josh Berkus
Date:
Subject: Re: temporal support patch