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 5F62E5E46E9 for ; Wed, 1 Sep 2004 02:20:07 -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 97995-04 for ; Wed, 1 Sep 2004 05:20:01 +0000 (GMT) Received: from rock.spider.ru (rock.spider.ru [62.183.34.226]) by svr1.postgresql.org (Postfix) with ESMTP id A644E5E46C3 for ; Wed, 1 Sep 2004 02:20:01 -0300 (ADT) Received: from rock (localhost [127.0.0.1]) by rock (Postfix) with SMTP id 29D4C2B321; Wed, 1 Sep 2004 09:20:00 +0400 (MSD) Received: from sad.localnet.ru (sad.localnet.ru [10.0.0.72]) by rock.spider.ru (Postfix) with ESMTP id EF73527430; Wed, 1 Sep 2004 09:19:59 +0400 (MSD) Content-Type: text/plain; charset="iso-8859-1" From: sad Organization: IT To: Michael Glaesemann Subject: Re: casting BOOL to somthng Date: Wed, 1 Sep 2004 08:29:00 +0400 User-Agent: KMail/1.4.3 Cc: pgsql-sql@postgresql.org References: <200408311306.25545.sad@bankir.ru> <200408311524.16036.sad@bankir.ru> <8618C5BA-FB54-11D8-A2A0-000A95C88220@myrealbox.com> In-Reply-To: <8618C5BA-FB54-11D8-A2A0-000A95C88220@myrealbox.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200409010829.00893.sad@bankir.ru> 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/2 X-Sequence-Number: 18848 On Tuesday 31 August 2004 17:49, Michael Glaesemann wrote: > On Aug 31, 2004, at 8:24 PM, sad wrote: > > and i am still desire to know _WHY_ there are no predefined cast for > > BOOL ? > > and at the same time there are predefined casts for INT and FLOAT...... > > I think the main reason is what is the proper textual representation of > BOOLEAN? True, PostgreSQL returns 't' as a representation for the > BOOLEAN value TRUE, but some people might want it to return 'TRUE' or > 'true' or other representations. Picking one is perhaps arbitrary. There are many (infinite number) of INT representations, "Picking one is perhaps arbitrary." But you poke one and using it. If some one wants another representation you ask him do define his own=20 function and use it instead of cast. And you are right. In your system=20 integers textully represented as you define. Just define one representation= =20 for boolean and leave the rest for user definition.