Re: [HACKERS] Current int & float overflow checking is slow.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [HACKERS] Current int & float overflow checking is slow.
Дата
Msg-id 23311.1508855802@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [HACKERS] Current int & float overflow checking is slow.  (Andres Freund <andres@anarazel.de>)
Ответы Re: [HACKERS] Current int & float overflow checking is slow.  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Andres Freund <andres@anarazel.de> writes:
> On 2017-10-24 10:09:09 -0400, Tom Lane wrote:
>> There's an ancient saying that code can be arbitrarily fast if it
>> doesn't have to get the right answer.  I think this proposal falls
>> in that category.

> Does it? In plenty of cases getting infinity rather than an error is
> just about as useful.
> This was argued by a certain Tom Lane a few years back ;)
> http://archives.postgresql.org/message-id/19208.1167246902%40sss.pgh.pa.us

Yeah, but I lost the argument.  For better or worse, our expected
behavior is now that we throw errors.  You don't get to change that
just because it would save a few cycles.

>> SIGFPE isn't going to be easy to recover from, nor portable.

> Hm? A trivial hack implementing the above survives the regression test,
> with the exception of one output change because some functions currently
> do *not* check for overflow.  What's the issue you're concerned about?

The real problem with it is that it's a process-wide setting, and would
for example probably break PL/R, or other libraries that are not expecting
to lose control to overflows.
        regards, tom lane


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] CurTransactionContext freed before transaction COMMIT ???
Следующее
От: Simon Riggs
Дата:
Сообщение: Re: [HACKERS] Remove secondary checkpoint