Re: PATCH: psql boolean display
От | Phil Sorber |
---|---|
Тема | Re: PATCH: psql boolean display |
Дата | |
Msg-id | CADAkt-h4YtHxxcDXRHtNKGe5Nmu3O7O3fwLpMs2LPLQMAPAFRw@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: PATCH: psql boolean display (Thom Brown <thom@linux.com>) |
Список | pgsql-hackers |
<p><br /> On Aug 20, 2012 6:31 PM, "Thom Brown" <<a href="mailto:thom@linux.com">thom@linux.com</a>> wrote:<br /> ><br/> > On 20 August 2012 23:16, Phil Sorber <<a href="mailto:phil@omniti.com">phil@omniti.com</a>> wrote:<br/> > ><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, "PhilSorber" <<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 toallow you to change the output of a<br /> > >> >> >> > >> boolean<br /> > >> >>>> > >> value in psql much like you can do with NULL. A client<br /> > >> >> >>> >> requested<br /> > >> >> >> > >> this<br /> > >> >> >>> >> feature and we thought it may 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 /> > >> >> >> > >> SELECT true, false;<br /> > >>>> >> > >> bool | bool<br /> > >> >> >> > >> ------+------<br/> > >> >> >> > >> t | f<br /> > >> >> >> > >>(1 row)<br /> > >> >> >> > >><br /> > >> >> >> > >> \psetbooltrue '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 /> > >> >> >> > >> Asalways, 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<br/> > >> >> >> > server<br /> > >> >> >> > side solution.<br /> >>> >> >> ><br /> > >> >> >><br /> > >> >> >> Was a serverside implementation submitted before? I can change it,<br /> > >> >> >> 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. :)<br /> > ><br /> > >Really server would override client.<br /> ><br /> > Come to think of it, if the client could detect the server'sbool out<br /> > config, it could override the server in that instance since it would<br /> > know what itwas looking for, so perhaps they could coexist.<p>I think Pavel has a patch in that is meant to sync variables betweenclient and server. Perhaps we can use the same facility?<p>><br /> > --<br /> > Thom<br />
В списке pgsql-hackers по дате отправления: