pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #15692: infinity loop
5+ messages / 5 participants
[nested] [flat]

* BUG #15692: infinity loop
@ 2019-03-13 10:05  PG Bug reporting form <noreply@postgresql.org>
  0 siblings, 2 replies; 5+ messages in thread

From: PG Bug reporting form @ 2019-03-13 10:05 UTC (permalink / raw)
  To: pgsql-bugs@lists.postgresql.org; +Cc: allyanaliev@gmail.com

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.



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: BUG #15692: infinity loop
@ 2019-03-13 11:00  Oleksandr Shulgin <oleksandr.shulgin@zalando.de>
  parent: PG Bug reporting form <noreply@postgresql.org>
  1 sibling, 0 replies; 5+ messages in thread

From: Oleksandr Shulgin @ 2019-03-13 11:00 UTC (permalink / raw)
  To: allyanaliev@gmail.com; pgsql-bugs@lists.postgresql.org

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

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: BUG #15692: infinity loop
@ 2019-03-13 11:04  Sergei Kornilov <sk@zsrv.org>
  parent: PG Bug reporting form <noreply@postgresql.org>
  1 sibling, 1 reply; 5+ messages in thread

From: Sergei Kornilov @ 2019-03-13 11:04 UTC (permalink / raw)
  To: allyanaliev@gmail.com <allyanaliev@gmail.com>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>

Hi

> At last command PostgreSQL comming inside infinity loop.

I have message "ERROR:  value overflows numeric format" very quickly for both 11.2 and HEAD versions.

regards, Sergei




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: BUG #15692: infinity loop
@ 2019-03-13 12:43  Dean Rasheed <dean.a.rasheed@gmail.com>
  parent: Sergei Kornilov <sk@zsrv.org>
  0 siblings, 1 reply; 5+ messages in thread

From: Dean Rasheed @ 2019-03-13 12:43 UTC (permalink / raw)
  To: Sergei Kornilov <sk@zsrv.org>; +Cc: allyanaliev@gmail.com <allyanaliev@gmail.com>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>

On Wed, 13 Mar 2019 at 11:04, Sergei Kornilov <sk@zsrv.org> wrote:
>
> > At last command PostgreSQL comming inside infinity loop.
>
> I have message "ERROR:  value overflows numeric format" very quickly for both 11.2 and HEAD versions.
>

Yeah, in any modern Postgres (9.6 or later) this calculation fails
with a numeric overflow in less than a millisecond for me. That's
consistent with the fact that numeric calculations were improved
somewhat in 9.6.

In older versions (9.0 - 9.5 inclusive), which includes 4 old
unsupported versions, it takes a little over a second to fail.
Certainly not an "infinity loop".

In really old versions (I tested 8.3 and 8.4) it does indeed appear to
go into an near-infinite loop, but frankly, anyone running 8.4 or
older has bigger problems.

Regards,
Dean




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: BUG #15692: infinity loop
@ 2019-03-13 12:57  Alisher Aliev <allyanaliev@gmail.com>
  parent: Dean Rasheed <dean.a.rasheed@gmail.com>
  0 siblings, 0 replies; 5+ messages in thread

From: Alisher Aliev @ 2019-03-13 12:57 UTC (permalink / raw)
  To: Dean Rasheed <dean.a.rasheed@gmail.com>; +Cc: Sergei Kornilov <sk@zsrv.org>; pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>

Thanks for replying

On Wed, 13 Mar 2019, 14:43 Dean Rasheed, <dean.a.rasheed@gmail.com> wrote:

> On Wed, 13 Mar 2019 at 11:04, Sergei Kornilov <sk@zsrv.org> wrote:
> >
> > > At last command PostgreSQL comming inside infinity loop.
> >
> > I have message "ERROR:  value overflows numeric format" very quickly for
> both 11.2 and HEAD versions.
> >
>
> Yeah, in any modern Postgres (9.6 or later) this calculation fails
> with a numeric overflow in less than a millisecond for me. That's
> consistent with the fact that numeric calculations were improved
> somewhat in 9.6.
>
> In older versions (9.0 - 9.5 inclusive), which includes 4 old
> unsupported versions, it takes a little over a second to fail.
> Certainly not an "infinity loop".
>
> In really old versions (I tested 8.3 and 8.4) it does indeed appear to
> go into an near-infinite loop, but frankly, anyone running 8.4 or
> older has bigger problems.
>
> Regards,
> Dean
>

^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2019-03-13 12:57 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-03-13 10:05 BUG #15692: infinity loop PG Bug reporting form <noreply@postgresql.org>
2019-03-13 11:00 ` Oleksandr Shulgin <oleksandr.shulgin@zalando.de>
2019-03-13 11:04 ` Sergei Kornilov <sk@zsrv.org>
2019-03-13 12:43   ` Dean Rasheed <dean.a.rasheed@gmail.com>
2019-03-13 12:57     ` Alisher Aliev <allyanaliev@gmail.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox