From: Michael Glaesemann <grzm@myrealbox.com>
To: sad <sad@bankir.ru>
Cc: Stephan Szabo <sszabo@megazone.bigpanda.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: casting BOOL to somthng
Date: Wed, 1 Sep 2004 16:03:51 +0900
Message-ID: <143DAF2B-FBE5-11D8-A2A0-000A95C88220@myrealbox.com> (raw)
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>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: grzm@myrealbox.com, sad@bankir.ru, sszabo@megazone.bigpanda.com
Subject: Re: casting BOOL to somthng
In-Reply-To: <143DAF2B-FBE5-11D8-A2A0-000A95C88220@myrealbox.com>
References: <200408311306.25545.sad@bankir.ru> <200409010941.54539.sad@bankir.ru> <8AF2CE57-FBE1-11D8-A2A0-000A95C88220@myrealbox.com> <200409010955.45834.sad@bankir.ru> <143DAF2B-FBE5-11D8-A2A0-000A95C88220@myrealbox.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox