Re: BUG #15692: infinity loop

Поиск
Список
Период
Сортировка
От Oleksandr Shulgin
Тема Re: BUG #15692: infinity loop
Дата
Msg-id CACACo5RDL8XLk3sdJTiZMRUkR2zR2hemhrzeOz6v-4HrsRoOiQ@mail.gmail.com
обсуждение исходный текст
Ответ на BUG #15692: infinity loop  (PG Bug reporting form <noreply@postgresql.org>)
Список pgsql-bugs
On Wed, Mar 13, 2019 at 11:21 AM PG Bug reporting form <noreply@postgresql.org> wrote:
The following bug has been logged on the website:

Bug reference:      15692
Logged by:          Alisher Aliev
Email address:      allyanaliev@gmail.com
PostgreSQL version: Unsupported/Unknown
Operating system:   CentOS Linux 7
Description:       

create table numer (n numeric);
insert into numer values (1);
insert into numer values (2);
insert into numer values (3);
select * from numer;
update numer set n = n * 10;
update numer set n = n * 7777777777777777777777777;
update numer set n = n ^ 1000;
update numer set n = n ^ 1000;

At last command PostgreSQL comming inside infinity loop.

How long the "infinity" lasts depends on how fast your hardware is (assuming you do have enough memory to hold the result).
Which behavior did you expect?  You asked the system to calculate the answer precisely, which is going to be a really long number, it's going to take some time to get you the answer.
If imprecise answer is an option, you could use floating point data type instead, like "double precision".

Regards,
--
Alex

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

Предыдущее
От: PG Bug reporting form
Дата:
Сообщение: BUG #15692: infinity loop
Следующее
От: Sergei Kornilov
Дата:
Сообщение: Re: BUG #15692: infinity loop