Bug report - incorrect value displayed in jsonb column for large numbers - Mailing list pgsql-bugs

From Michał Iwańczuk
Subject Bug report - incorrect value displayed in jsonb column for large numbers
Date
Msg-id CAG0+XYDbm=EuwxoXGQf=gFRpt8Fe-f805tNnTLxoBp23xwSG=g@mail.gmail.com
Whole thread Raw
Responses Re: Bug report - incorrect value displayed in jsonb column for large numbers
List pgsql-bugs
Hello,
I hope that it is correct place for bug report.

I have found bug in pg admin where if jsonb contains field with large numerical value (maybe extending JS Number.MAX_SAFE_INTEGER value?) then value displayed in column gets incorrectly rounded). Whole issue is described in https://stackoverflow.com/questions/55491006/incorrect-insert-of-bigint-into-jsonb-column-when-using-pgadmin-4.

- PGAdmin4 version 3.6
- Ubuntu 18.04.2 LTS
- desktop mode
- repro steps:

0) open query tool in some db
1) create table:
CREATE TABLE document_wrapper
(   id integer NOT NULL,   document jsonb NOT NULL,   CONSTRAINT document_pkey PRIMARY KEY (id)
)
WITH (   OIDS = FALSE
)
TABLESPACE pg_default;

2) insert value

insert into document_wrapper(id, document) values(-8, '{"id":101861191707868275}');

3) select value

SELECT document FROM document_wrapper where id = -8;

4) Observe incorrect result (note 0 at the end):
{ "id": 101861191707868270 }?

If more info is needed please contact me

Michał Iwańczuk

pgsql-bugs by date:

Previous
From: r.zharkov@postgrespro.ru
Date:
Subject: Re: BUG #15727: PANIC: cannot abort transaction 295144144, it wasalready committed
Next
From: PG Bug reporting form
Date:
Subject: BUG #15732: Jessie backports removed from network