[pgAdmin4][RM3587] Browser rendering of a bigint in a jsonb is wrong

Поиск
Список
Период
Сортировка
От Aditya Toshniwal
Тема [pgAdmin4][RM3587] Browser rendering of a bigint in a jsonb is wrong
Дата
Msg-id CAM9w-_mLA=x_f_2budz2iEqc2Mp8dcM9XjqD6R5RsCkU5ndZsg@mail.gmail.com
обсуждение исходный текст
Ответы Re: [pgAdmin4][RM3587] Browser rendering of a bigint in a jsonb is wrong  (Dave Page <dpage@pgadmin.org>)
Список pgadmin-hackers
Hi Hackers,

Attached is the patch to fix incorrect rendering of bigint in jsonb. 
The problem is in javascript limitations with big numbers. For fixing, jsonb data will be fetched as string now, similar to json, so that JS will not consider big numbers as number. The only drawback here is that, the popup editor will not show formatted json, as that requires JSON.parse which will change the big numbers.

Kindly review.

Below is sample data for testing:
CREATE TABLE public.tab_jsonbigint
(
    id integer NOT NULL PRIMARY KEY,
    coljsonb jsonb
)

insert into tab_jsonbigint(id, coljsonb) values(3,'[{"a": 83136002445762248}, {"a": 831360024457622448}]');

select d.*, t.coljsonb from tab_jsonbigint t, jsonb_to_recordset(t.coljsonb) as d("a" bigint);



--
Thanks and Regards,
Aditya Toshniwal
Software Engineer | EnterpriseDB Software Solutions | Pune
"Don't Complain about Heat, Plant a tree"
Вложения

В списке pgadmin-hackers по дате отправления:

Предыдущее
От: Dave Page
Дата:
Сообщение: pgAdmin 4 commit: Fix the text highlight colour.
Следующее
От: Khushboo Vashi
Дата:
Сообщение: [pgAdmin4][Patch] - Encoding Fixes