Re: [HACKERS] Division by Zero - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: [HACKERS] Division by Zero
Date
Msg-id 199804141704.NAA25672@candle.pha.pa.us
Whole thread Raw
In response to Division by Zero  (David Hartwig <daveh@insightdist.com>)
List pgsql-hackers
>
> This is a multi-part message in MIME format.
> --------------0BE30DC54DE04265764E3F7C
> Content-Type: text/plain; charset=us-ascii
> Content-Transfer-Encoding: 7bit
>
> I have noticed that when float types are divided by zero in a query, the
> the query aborts (via elog(WARN)) with a complaint about divide by zero.
>
> Also an integer divide by zero produces a result.  On our AIX 4.1.4
> system 1 / 0 = 15.    And 10 / 0 = 31.   There is some pattern here with
> integers, but it is of little use.

On BSDI:

test=> select 1/0;
ERROR:  floating point exception! The last floating point operation
either exceeded legal ranges or was a divide by zero

I think a transaction abort is the only normal solution.

--
Bruce Momjian                          |  830 Blythe Avenue
maillist@candle.pha.pa.us              |  Drexel Hill, Pennsylvania 19026
  +  If your life is a hard drive,     |  (610) 353-9879(w)
  +  Christ can be your backup.        |  (610) 853-3000(h)

pgsql-hackers by date:

Previous
From: David Hartwig
Date:
Subject: Division by Zero
Next
From: aoki@CS.Berkeley.EDU (Paul M. Aoki)
Date:
Subject: Re: [HACKERS] Safe/Fast I/O ...