Bug report - incorrect value displayed in jsonb column for large numbers

From: Michał Iwańczuk <miwanczuk7(at)gmail(dot)com>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Bug report - incorrect value displayed in jsonb column for large numbers
Date: 2019-04-03 13:29:46
Message-ID: CAG0+XYDbm=EuwxoXGQf=gFRpt8Fe-f805tNnTLxoBp23xwSG=g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2019-04-03 15:29:18 BUG #15732: Jessie backports removed from network
Previous Message r.zharkov 2019-04-03 12:59:23 Re: BUG #15727: PANIC: cannot abort transaction 295144144, it was already committed