Re: Casting INT4 to BOOL...

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Sean Chittenden <chitt(at)speakeasy(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: Casting INT4 to BOOL...
Date: 2004-10-14 22:33:46
Message-ID: 200410142233.i9EMXlV12058@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches


This has been saved for the 8.1 release:

http:/momjian.postgresql.org/cgi-bin/pgpatches2

---------------------------------------------------------------------------

Sean Chittenden wrote:
> >> Is there any reason why the backend doesn't cast an unquoted integer
> >> to
> >> a boolean value?
> >
> > Hidden cross-category typecasts are evil. I'd accept this as an
> > explicit cast ('e' in pg_cast) but not automatic.
> >
> > Also, what about the other direction? Providing a cast in only one
> > direction is pretty inconsistent.
>
> test=> SELECT 1::BOOL, 0::BOOL, TRUE::INT4, FALSE::INT4;
> bool | bool | int4 | int4
> ------+------+------+------
> t | f | 1 | 0
> (1 row)
>
> Okey doke, both directions are now provided and the cast has to be
> explicit. -sc
>

[ Attachment, skipping... ]

>
>
> --
> Sean Chittenden

>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Browse pgsql-patches by date

  From Date Subject
Next Message Neil Conway 2004-10-15 01:36:51 Re: pg_ctl cleanup
Previous Message Bruce Momjian 2004-10-14 22:18:10 Re: Slightly better testing for pg_ctl(1)'s -w...