Re: BUG #15692: infinity loop

From: Oleksandr Shulgin <oleksandr(dot)shulgin(at)zalando(dot)de>
To: allyanaliev(at)gmail(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #15692: infinity loop
Date: 2019-03-13 11:00:13
Message-ID: CACACo5RDL8XLk3sdJTiZMRUkR2zR2hemhrzeOz6v-4HrsRoOiQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Wed, Mar 13, 2019 at 11:21 AM PG Bug reporting form <
noreply(at)postgresql(dot)org> wrote:

> The following bug has been logged on the website:
>
> Bug reference: 15692
> Logged by: Alisher Aliev
> Email address: allyanaliev(at)gmail(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Sergei Kornilov 2019-03-13 11:04:32 Re: BUG #15692: infinity loop
Previous Message PG Bug reporting form 2019-03-13 10:05:09 BUG #15692: infinity loop