Re: Boolean casting in 7.3 -> changed?

From: David Walker <pgsql(at)grax(dot)com>
To: PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Boolean casting in 7.3 -> changed?
Date: 2002-11-28 00:34:12
Message-ID: 200211271834.12241.pgsql@grax.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Does this mean that in the future '342' may not be valid as an insert into a
numeric field and that we should be using 342 instead?

On Wednesday 27 November 2002 05:07 pm, (Via wrote:
> Ian Barwick writes:
> > "Casting integers to boolean (for example, 0::bool) is no longer allowed,
> > use '0'::bool instead".
>
> This advice would probably only cause more confusion, because we are now
> moving into the direction that character strings are no longer acceptable
> as numeric data.
>
> Note that
>
> x <> 0
>
> is also a perfectly good way to convert integers to booleans, and a more
> portable one at that.
>
> Finally, you can always create your own cast.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Christopher Kings-Lynne 2002-11-28 02:31:37 Re: Planning for improved versions of IN/NOT IN
Previous Message Tom Lane 2002-11-27 23:56:31 Planning for improved versions of IN/NOT IN