Re: PATCH: psql boolean display
От | Phil Sorber |
---|---|
Тема | Re: PATCH: psql boolean display |
Дата | |
Msg-id | CADAkt-izZfb8KQjbBAkjqVMAB1UOPa-iqdbEUpuXqd+QSmT=kg@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: PATCH: psql boolean display (Pavel Stehule <pavel.stehule@gmail.com>) |
Ответы |
Re: PATCH: psql boolean display
|
Список | pgsql-hackers |
<p>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 Robert Haas <<ahref="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 patchto allow you to change the output of a boolean<br /> > >> value in psql much like you can do with NULL. A clientrequested this<br /> > >> feature and we thought it may appeal to someone else in the community.<br /> >>><br /> > >> The patch includes updated docs and a regression test. The code<br /> > >> changesthemselves are pretty simple and straightforward.<br /> > >><br /> > >> Example from the regressiontest:<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 /> > >> SELECTtrue, 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 ASwhatever;<br /> ><br /> > I understand this motivation - although I was more happy with server<br /> > side solution.<br/> ><p>Was a server side implementation submitted before? I can change it, but I did it on the client sidelike the null display was done.<p>> 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 mailing list (<a href="mailto:pgsql-hackers@postgresql.org">pgsql-hackers@postgresql.org</a>)<br/> > > To make changes to your subscription:<br/> > > <a href="http://www.postgresql.org/mailpref/pgsql-hackers">http://www.postgresql.org/mailpref/pgsql-hackers</a><br/>
В списке pgsql-hackers по дате отправления: