Using NULL values in calculated results

Started by Zak McGregorabout 25 years ago2 messagesgeneral
Jump to latest
#1Zak McGregor
zak@mighty.co.za

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

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Zak McGregor (#1)
Re: Using NULL values in calculated results

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