pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: sad <sad@bankir.ru>
To: Michael Glaesemann <grzm@myrealbox.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: casting BOOL to somthng
Date: Wed, 1 Sep 2004 08:29:00 +0400
Message-ID: <200409010829.00893.sad@bankir.ru> (raw)
In-Reply-To: <8618C5BA-FB54-11D8-A2A0-000A95C88220@myrealbox.com>
References: <200408311306.25545.sad@bankir.ru>
	<200408311524.16036.sad@bankir.ru>
	<8618C5BA-FB54-11D8-A2A0-000A95C88220@myrealbox.com>

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 
function and use it instead of cast. And you are right. In your system 
integers textully represented as you define. Just define one representation 
for boolean and leave the rest for user definition.




view thread (19+ messages)  latest in thread

Message-ID: <200409010829.00893.sad@bankir.ru>
Permalink:  ../200409010829.00893.sad@bankir.ru/
Also on:    postgresql.org/message-id/200409010829.00893.sad@bankir.ru

 · 

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: sad@bankir.ru, grzm@myrealbox.com
  Subject: Re: casting BOOL to somthng
  In-Reply-To: <200409010829.00893.sad@bankir.ru>

* 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