Thread: Using NULL values in calculated results

Using NULL values in calculated results

From
Zak McGregor
Date:
Hi all

Am I wrong in thinking that any mathematical operation with a null value
should result in a null result? The reason I ask is that the following all
behave as expected:
select 1+null => null
select 1*null => null

but select 1/null => division by zero error. Is this how it is supposed to
work? I've tried on 7.0.2 and 7.0.3.


Thanks

Cheers

Zak

Re: Using NULL values in calculated results

From
Tom Lane
Date:
Zak McGregor <zak@mighty.co.za> writes:
> but select 1/null => division by zero error. Is this how it is supposed to
> work?

Nope.  It's fixed for 7.1.

            regards, tom lane