Re: BUG #15692: infinity loop - Mailing list pgsql-bugs

From Oleksandr Shulgin
Subject Re: BUG #15692: infinity loop
Date
Msg-id CACACo5RDL8XLk3sdJTiZMRUkR2zR2hemhrzeOz6v-4HrsRoOiQ@mail.gmail.com
Whole thread Raw
In response to BUG #15692: infinity loop  (PG Bug reporting form <noreply@postgresql.org>)
List 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 by date:

Previous
From: PG Bug reporting form
Date:
Subject: BUG #15692: infinity loop
Next
From: Sergei Kornilov
Date:
Subject: Re: BUG #15692: infinity loop