X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 368DE5E46C3 for ; Wed, 1 Sep 2004 04:04:25 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 28904-07 for ; Wed, 1 Sep 2004 07:04:22 +0000 (GMT) Received: from laughter.local (unknown [61.115.206.98]) by svr1.postgresql.org (Postfix) with ESMTP id 0C2C05E46E9 for ; Wed, 1 Sep 2004 04:04:21 -0300 (ADT) Received: from [127.0.0.1] (localhost [127.0.0.1]) by laughter.local (Postfix) with ESMTP id EC5EF2C004D; Wed, 1 Sep 2004 16:03:52 +0900 (JST) In-Reply-To: <200409010955.45834.sad@bankir.ru> References: <200408311306.25545.sad@bankir.ru> <200409010941.54539.sad@bankir.ru> <8AF2CE57-FBE1-11D8-A2A0-000A95C88220@myrealbox.com> <200409010955.45834.sad@bankir.ru> Mime-Version: 1.0 (Apple Message framework v619) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <143DAF2B-FBE5-11D8-A2A0-000A95C88220@myrealbox.com> Content-Transfer-Encoding: 7bit Cc: Stephan Szabo , pgsql-sql@postgresql.org From: Michael Glaesemann Subject: Re: casting BOOL to somthng Date: Wed, 1 Sep 2004 16:03:51 +0900 To: sad X-Mailer: Apple Mail (2.619) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200409/8 X-Sequence-Number: 18854 On Sep 1, 2004, at 2:55 PM, sad wrote: > On Wednesday 01 September 2004 10:38, Michael Glaesemann wrote: >> On Sep 1, 2004, at 2:41 PM, sad wrote: >>> On Wednesday 01 September 2004 09:24, Stephan Szabo wrote: >>>> There's a fairly accepted convention for integer representations. >>>> There's no such convention for boolean representations. >>> >>> then why do you print its value on a screen ?! >> >> Perhaps because if you don't print *something* you can't see it? > > since you printed it you poke a convention (of casting to string) OT: 'pick' or 'choose'. 'Poke' means something else entirely. > if you can print it on screen why not to print it in string? I can see your point, but I think that representing the value and casting the value to another type are two different things. Given, as Stephen pointed out, that there is no standard convention for representing BOOLEAN values, whatever the choice is is not going to satisfy nearly anyone. For me, I would *not* want TRUE to be represented as 't', nor would I want to have to set up a separate cast (or formating function, or CASE statement) to make it print 'TRUE'. Others, I'm sure, would rather see it as 'true' (lowercase). Why should they be penalized to suit me? I've seen very few people ask for a cast from BOOLEAN to TEXT. Given the apparently limited number of people who desire it, and the various ways BOOLEAN may be represented as text, I think it's much better to leave it up to the individual user to define their own cast to do so, and PostgreSQL provides an easy method to do so. Michael Glaesemann grzm myrealbox com