[pgAdmin4][RM3600] json values changed when printed by pgadmin4 - Mailing list pgadmin-hackers

From Aditya Toshniwal
Subject [pgAdmin4][RM3600] json values changed when printed by pgadmin4
Date
Msg-id CAM9w-_k5Nj=p23hxGQn45eOavsF7f+EUZNX54=jgiiknLaVw0A@mail.gmail.com
Whole thread Raw
Responses Re: [pgAdmin4][RM3600] json values changed when printed by pgadmin4  (Dave Page <dpage@pgadmin.org>)
List pgadmin-hackers
Hi Hackers,

Attached is the patch to fix data alterations done in pgAdmin4 for json datatype. pgAdmin4 will not change json data in any way, and will treat json data as text for data type json. Note that, this is not applicable for jsonb.
Also added jsonb editing validation.

An enhancement which I have added with this patch is when you do double click on the slick grid column resize bar, the column will expand to maximum width of data.

Below is sample data for testing:

CREATE TABLE public.tab_jsontest
(
    id integer NOT NULL PRIMARY KEY,
    coljson json,
    coljsonarr json[],
    coljsonb jsonb,
    coljsonbarr jsonb[]
)

insert into tab_jsontest values(1,'{"sender":"pablo","body":"they are on to us"}','{"{\"sody\": \"they are on to us\", \"bender\": \"pablo\"}","{\"sender\": \"arthur\"}"}','{"sender":"pablo","body":"they are on to us"}','{"{\"body\": \"they are on to us\", \"sender\": \"pablo\"}","{\"sender\": \"arthur\"}"}')

Kindly review.
--
Thanks and Regards,
Aditya Toshniwal
Software Engineer | EnterpriseDB Software Solutions | Pune
"Don't Complain about Heat, Plant a tree"
Attachment

pgadmin-hackers by date:

Previous
From: Akshay Joshi
Date:
Subject: Re: [pgAdmin4][Patch]: Feature #2418 add rollback and commit actionbuttons on Query Tool
Next
From: Dave Page
Date:
Subject: pgAdmin 4 commit: Add Commit and Rollback buttons to the Query Tool.Fi