[pgAdmin4][RM3600] json values changed when printed by pgadmin4

From: Aditya Toshniwal <aditya(dot)toshniwal(at)enterprisedb(dot)com>
To: pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org>
Subject: [pgAdmin4][RM3600] json values changed when printed by pgadmin4
Date: 2019-02-22 13:08:02
Message-ID: CAM9w-_k5Nj=p23hxGQn45eOavsF7f+EUZNX54=jgiiknLaVw0A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 Content-Type Size
RM3600.patch application/octet-stream 17.3 KB

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message Dave Page 2019-02-22 14:28:13 pgAdmin 4 commit: Add Commit and Rollback buttons to the Query Tool. Fi
Previous Message Akshay Joshi 2019-02-22 12:19:21 Re: [pgAdmin4][Patch]: Feature #2418 add rollback and commit action buttons on Query Tool