pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: sad <sad@bankir.ru>
To: Geoffrey <esoteric@3times25.net>
To: pgsql-sql@postgresql.org
Subject: Re: casting BOOL to somthng
Date: Wed, 1 Sep 2004 08:22:37 +0400
Message-ID: <200409010822.37712.sad@bankir.ru> (raw)
In-Reply-To: <41346D6C.30804@3times25.net>
References: <200408311306.25545.sad@bankir.ru>
	<200408311524.16036.sad@bankir.ru>
	<41346D6C.30804@3times25.net>

On Tuesday 31 August 2004 16:22, Geoffrey wrote:
> sad wrote:
> > you wrote:
> >>you can use CREATE CAST to make your own cast from boolean to text.
> >
> > thnx it helps.
> >
> > 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'd like to understand in what context you would find this useful.
> Don't take me wrong please.  I'm by no means a db expert, but I can't
> see a purpose for such a cast.  Can you provide a reasonable example of
> such usage?

Yes i can. 
look:

CREATE TABLE t (a int, b text, c bool);

SELECT 'the row is: a='||a::TEXT||' b='||b||' c='||c::TEXT FROM t;




view thread (19+ messages)  latest in thread

Message-ID: <200409010822.37712.sad@bankir.ru>
Permalink:  ../200409010822.37712.sad@bankir.ru/
Also on:    postgresql.org/message-id/200409010822.37712.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, esoteric@3times25.net
  Subject: Re: casting BOOL to somthng
  In-Reply-To: <200409010822.37712.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