Re: PATCH: psql boolean display

Поиск
Список
Период
Сортировка
От Phil Sorber
Тема Re: PATCH: psql boolean display
Дата
Msg-id CADAkt-ieJkB5Lqk-6b4MZiUD=Qm=VQ2QDp4VVUAN7zF2Esja9A@mail.gmail.com
обсуждение исходный текст
Ответ на Re: PATCH: psql boolean display  (Thom Brown <thom@linux.com>)
Ответы Re: PATCH: psql boolean display
Список pgsql-hackers
<p><br /> On Aug 20, 2012 6:08 PM, "Thom Brown" <<a href="mailto:thom@linux.com">thom@linux.com</a>> wrote:<br />
><br/> > On 20 August 2012 23:06, Phil Sorber <<a href="mailto:phil@omniti.com">phil@omniti.com</a>>
wrote:<br/> > ><br /> > > On Aug 20, 2012 5:56 PM, "Thom Brown" <<a
href="mailto:thom@linux.com">thom@linux.com</a>>wrote:<br /> > >><br /> > >> On 20 August 2012
22:31,Phil Sorber <<a href="mailto:phil@omniti.com">phil@omniti.com</a>> wrote:<br /> > >> > 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>><br/> > >> >> wrote:<br /> >
>>>> ><br /> > >> >> > 2012/8/20 Robert Haas <<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>><br /> > >>
>>> > wrote:<br /> > >> >> > >> I am providing a patch to allow you to change the
outputof a<br /> > >> >> > >> boolean<br /> > >> >> > >> value in psql
muchlike you can do with NULL. A client requested<br /> > >> >> > >> this<br /> > >>
>>> >> feature and we thought it may appeal to someone else in the<br /> > >> >> >
>>community.<br /> > >> >> > >><br /> > >> >> > >> The patch
includesupdated docs and a regression test. The code<br /> > >> >> > >> changes themselves are
prettysimple and straightforward.<br /> > >> >> > >><br /> > >> >> > >>
Examplefrom the regression test:<br /> > >> >> > >><br /> > >> >> > >>
SELECTtrue, 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 /> > >> >>
Wasa server side implementation submitted before? I can change it, but<br /> > >> >> I<br /> >
>>>> did it on the client side like the null display was done.<br /> > >> ><br /> > >>
>Or how about both?<br /> > >><br /> > >> Surely one would break the other?<br /> > >><br
/>> ><br /> > > If using both.<br /> ><br /> > Yes. :)<p>Really server would override
client.<p>><br/> > --<br /> > Thom<br /> 

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Gurjeet Singh
Дата:
Сообщение: Re: PATCH: psql boolean display
Следующее
От: "Kevin Grittner"
Дата:
Сообщение: Re: PATCH: psql boolean display