Re: casting BOOL to somthng

From: sad <sad(at)bankir(dot)ru>
To: Geoffrey <esoteric(at)3times25(dot)net>, pgsql-sql(at)postgresql(dot)org
Subject: Re: casting BOOL to somthng
Date: 2004-09-01 04:22:37
Message-ID: 200409010822.37712.sad@bankir.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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;

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message sad 2004-09-01 04:29:00 Re: casting BOOL to somthng
Previous Message Greg Sabino Mullane 2004-08-31 23:19:31 Re: colored PL with emacs