Re: [HACKERS] Division by Zero

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: [HACKERS] Division by Zero
Дата
Msg-id 199804141704.NAA25672@candle.pha.pa.us
обсуждение исходный текст
Ответ на Division by Zero  (David Hartwig <daveh@insightdist.com>)
Список 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 по дате отправления:

Предыдущее
От: David Hartwig
Дата:
Сообщение: Division by Zero
Следующее
От: aoki@CS.Berkeley.EDU (Paul M. Aoki)
Дата:
Сообщение: Re: [HACKERS] Safe/Fast I/O ...