Re: Boolean casting in 7.3 -> changed?

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Ian Barwick <barwick(at)gmx(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Boolean casting in 7.3 -> changed?
Date: 2002-11-27 23:07:17
Message-ID: Pine.LNX.4.44.0211271943140.12428-100000@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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.

--
Peter Eisentraut peter_e(at)gmx(dot)net

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message scott.marlowe 2002-11-27 23:08:49 Re: [spam] Re: [mail] Re: Native Win32 sources
Previous Message Tom Lane 2002-11-27 22:21:48 Re: Fw: PostgreSQL 7.3 Platform Testing