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

From Phil Sorber
Subject Re: PATCH: psql boolean display
Date
Msg-id CADAkt-heXPw3xL=M4q0ESmKhR+Xqiw3CF5e+VA9rY111Y1ZNCg@mail.gmail.com
Whole thread Raw
In response to Re: PATCH: psql boolean display  (Phil Sorber <phil@omniti.com>)
Responses Re: PATCH: psql boolean display
List pgsql-hackers
<p>On Aug 20, 2012 5:19 PM, "Phil Sorber" <<a href="mailto:phil@omniti.com">phil@omniti.com</a>> wrote:<br />
><br/> > On Aug 20, 2012 5:11 PM, "Pavel Stehule" <<a
href="mailto:pavel.stehule@gmail.com">pavel.stehule@gmail.com</a>>wrote:<br /> > ><br /> > > 2012/8/20
RobertHaas <<a href="mailto:robertmhaas@gmail.com">robertmhaas@gmail.com</a>>:<br /> > > > On Sun, Aug
19,2012 at 12:02 PM, Phil Sorber <<a href="mailto:phil@omniti.com">phil@omniti.com</a>> wrote:<br /> > >
>>I am providing a patch to allow you to change the output of a boolean<br /> > > >> value in psql
muchlike you can do with NULL. A client requested this<br /> > > >> feature and we thought it may appeal to
someoneelse in the community.<br /> > > >><br /> > > >> The patch includes updated docs and a
regressiontest. The code<br /> > > >> changes themselves are pretty simple and straightforward.<br /> >
>>><br /> > > >> Example from the regression test:<br /> > > >><br /> > >
>>SELECT true, false;<br /> > > >>  bool | bool<br /> > > >> ------+------<br /> >
>>>  t    | f<br /> > > >> (1 row)<br /> > > >><br /> > > >> \pset
booltrue'foo'<br /> > > >> \pset boolfalse 'bar'<br /> > > >> SELECT true, false;<br /> >
>>>  bool | bool<br /> > > >> ------+------<br /> > > >>  foo  | bar<br /> > >
>>(1 row)<br /> > > >><br /> > > >> \pset booltrue 't'<br /> > > >> \pset
boolfalse'f'<br /> > > >> SELECT true, false;<br /> > > >>  bool | bool<br /> > >
>>------+------<br /> > > >>  t    | f<br /> > > >> (1 row)<br /> > > >><br
/>> > >> As always, comments welcome.<br /> > > ><br /> > > > Why not just do it in the
SQL?<br/> > > ><br /> > > > SELECT CASE WHEN whatever THEN 'foo' ELSE 'bar' END AS whatever;<br />
>><br /> > > I understand this motivation - although I was more happy with server<br /> > > side
solution.<br/> > ><br /> ><br /> > Was a server side implementation submitted before? I can change it, but
Idid it on the client side like the null display was done.<p>Or how about both?<p>><br /> > > Regards<br />
>><br /> > > Pavel Stehule<br /> > ><br /> > > ><br /> > > > --<br /> > >
>Robert Haas<br /> > > > EnterpriseDB: <a
href="http://www.enterprisedb.com">http://www.enterprisedb.com</a><br/> > > > The Enterprise PostgreSQL
Company<br/> > > ><br /> > > ><br /> > > > --<br /> > > > Sent via pgsql-hackers
mailinglist (<a href="mailto:pgsql-hackers@postgresql.org">pgsql-hackers@postgresql.org</a>)<br /> > > > To
makechanges to your subscription:<br /> > > > <a
href="http://www.postgresql.org/mailpref/pgsql-hackers">http://www.postgresql.org/mailpref/pgsql-hackers</a><br/> 

pgsql-hackers by date:

Previous
From: Phil Sorber
Date:
Subject: Re: PATCH: psql boolean display
Next
From: Thom Brown
Date:
Subject: Re: PATCH: psql boolean display