Re: PATCH: psql boolean display

Поиск
Список
Период
Сортировка
От Phil Sorber
Тема Re: PATCH: psql boolean display
Дата
Msg-id CADAkt-gBd_DRUyR6y_29Sq1UOjd4kBZ-XHsK+4JaNs689VaZoA@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 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:11PM, "Pavel Stehule" <<a href="mailto:pavel.stehule@gmail.com">pavel.stehule@gmail.com</a>> 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:02PM, 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
inpsql much like you can do with NULL. A client requested this<br /> > >> > >> feature and we thought
itmay appeal to someone else in the<br /> > >> > >> community.<br /> > >> > >><br
/>> >> > >> The patch includes updated docs and a regression test. The code<br /> > >> >
>>changes themselves are pretty simple and straightforward.<br /> > >> > >><br /> > >>
>>> Example from 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 /> > >> > >>
(1row)<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 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 /> ><p>If using
both.<p>>--<br /> > Thom<br /> 

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

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: PATCH: psql boolean display
Следующее
От: Thom Brown
Дата:
Сообщение: Re: PATCH: psql boolean display