pgadmin-org / pgadmin4

pgAdmin is the most popular and feature rich Open Source administration and development platform for PostgreSQL, the most advanced Open Source database in the world.
https://www.pgadmin.org
Other
2.46k stars 643 forks source link

Jsonb fields show up as [object Object] and can not be edited (RM #1404) #385

Closed dpage closed 2 years ago

dpage commented 8 years ago

Issue migrated from Redmine: https://redmine.postgresql.org/issues/1404 Originally created by Abe Johnson at 2016-06-25 19:08:15 UTC.

Jsonb fields show up as [object Object]

I am using 1.0 Beta 2 on Windows 7 64bit.

dpage commented 8 years ago

Comment migrated from Redmine: https://redmine.postgresql.org/issues/1404#note-1 Originally created by Murtuza Zabuawala at 2016-06-27 06:12:34 UTC.

Redmine ticket header update:

Name Old Value New Value
Status changed New In Progress
Assigned To changed Murtuza Zabuawala
dpage commented 8 years ago

Comment migrated from Redmine: https://redmine.postgresql.org/issues/1404#note-2 Originally created by Murtuza Zabuawala at 2016-06-27 07:57:28 UTC.

Sample test data, (Issue is re-producible on pgAdmin4 Beta-2 Windows build)


CREATE TABLE reviews(review jsonb);

insert into reviews values('

{

"customer_id": "ATVPDKIKX0DER",
"product": {
    "category": "Arts & Photography",
    "group": "Book",
    "id": "1854103040",
    "sales_rank": 72019,
    "similar_ids": [
        "1854102664",
        "0893815381",
        "0893816493",
        "3037664959",
        "089381296X"
    ],
    "subcategory": "Art",
    "title": "The Age of Innocence"
},
"review": {
    "date": "1995-08-10",
    "helpful_votes": 5,
    "rating": 5,
    "votes": 12
}

}

                       ')
dpage commented 8 years ago

Attachment migrated from Redmine: https://redmine.postgresql.org/attachments/download/1393 Originally created by Murtuza Zabuawala at 2016-06-29 09:46:25 UTC.

https://pgadmin-archive.postgresql.org/redmine/1404/1393-Capture-2.JPG

Description: Tested: Win10 (runtime)

dpage commented 8 years ago

Comment migrated from Redmine: https://redmine.postgresql.org/issues/1404#note-4 Originally created by Murtuza Zabuawala at 2016-06-29 09:46:52 UTC.

Patch sent, https://www.postgresql.org/message-id/CAKKotZTdssV2qpefo9z5fL%3D4i%2B4GpA8oHHfbsrSUCgCSxn9HKg%40mail.gmail.com

Tested on Windows Runtime (PFA screenshot)

Redmine ticket header update:

Name Old Value New Value
Attachment added Capture-2.JPG
dpage commented 8 years ago

Comment migrated from Redmine: https://redmine.postgresql.org/issues/1404#note-5 Originally created by Anonymous at 2016-07-04 09:06:06 UTC.

Applied in changeset commit:3ee8861d44bb458ef4e759d8924b9c05ef170f7c.

Redmine ticket header update:

Name Old Value New Value
Status changed In Progress In Testing
Done Ratio changed 0 90
dpage commented 8 years ago

Comment migrated from Redmine: https://redmine.postgresql.org/issues/1404#note-6 Originally created by Vishal Sawale at 2016-08-01 11:43:35 UTC.

This has been tested and patch is working. Now it is correctly displaying the json fields.

git commit - 5987af1b445b978bcd8d34b513c05ff25f954191

browser - IE,chorme,firefox

Redmine ticket header update:

Name Old Value New Value
Status changed In Testing Resolved
dpage commented 8 years ago

Comment migrated from Redmine: https://redmine.postgresql.org/issues/1404#note-7 Originally created by Murtuza Zabuawala at 2016-09-20 07:03:56 UTC.

Re-opening the issue as, We found new issue in Slick grid where it is showing JSON data as [object Object] if it is of array type in JSON datatype.

Redmine ticket header update:

Name Old Value New Value
Status changed Resolved In Progress
dpage commented 8 years ago

Comment migrated from Redmine: https://redmine.postgresql.org/issues/1404#note-8 Originally created by Murtuza Zabuawala at 2016-09-21 10:46:06 UTC.

Patch sent,

https://www.postgresql.org/message-id/CAKKotZTO2001ka4TBq6wnWtY0RkMr5%3DDb3XSSyB-Adhhwh4OVg%40mail.gmail.com

dpage commented 8 years ago

Comment migrated from Redmine: https://redmine.postgresql.org/issues/1404#note-9 Originally created by Dave Page at 2016-09-21 12:43:20 UTC.

Redmine ticket header update:

Name Old Value New Value
Fixed Version changed 1.0
dpage commented 8 years ago

Comment migrated from Redmine: https://redmine.postgresql.org/issues/1404#note-10 Originally created by Dave Page at 2016-09-21 12:43:32 UTC.

Applied in changeset commit:7a401713008c516d45798ac258dc15fbd6977e29.

Redmine ticket header update:

Name Old Value New Value
Status changed In Progress In Testing
dpage commented 8 years ago

Comment migrated from Redmine: https://redmine.postgresql.org/issues/1404#note-11 Originally created by Fahar Abbas at 2016-09-22 12:40:14 UTC.

Tested Platform: Windows 2012 64 bit Tested server EPAS-9.6 server Python 2.7.11

Murtaza,

Under JSONb data [object Object] is not displayed while we can not edit any information through view data, please note that user can view the data of emp, dept and jobhist table and can modify this.

Steps:

  1. create following table:

CREATE TABLE reviews(review jsonb);

insert into reviews values('

{

"customer_id": "ATVPDKIKX0DER", "product": { "category": "Arts & Photography", "group": "Book", "id": "1854103040", "sales_rank": 72019, "similar_ids": [ "1854102664", "0893815381", "0893816493", "3037664959", "089381296X" ], "subcategory": "Art", "title": "The Age of Innocence" }, "review": { "date": "1995-08-10", "helpful_votes": 5, "rating": 5, "votes": 12 } }

')

  1. expand this particular database
  2. Go into view data
  3. try to change value to jsonb
  4. User can not edit any information

Expected result:

Like others table user should modify the values in jsonb

Actual Result:

we can not modify value on jsonb table

Redmine ticket header update:

Name Old Value New Value
Status changed In Testing New
dpage commented 8 years ago

Comment migrated from Redmine: https://redmine.postgresql.org/issues/1404#note-12 Originally created by Murtuza Zabuawala at 2016-09-22 13:01:48 UTC.

You do not have primary key in your table, and we do not allow Insert/Update/Delete if table do not have Primary key present.

Redmine ticket header update:

Name Old Value New Value
Status changed New In Testing
Assigned To changed Murtuza Zabuawala Fahar Abbas
dpage commented 8 years ago

Comment migrated from Redmine: https://redmine.postgresql.org/issues/1404#note-13 Originally created by Fahar Abbas at 2016-09-22 13:56:32 UTC.

commit ID:

commit f48f8066573fdd46ce4cf4063d299aaf60bdbc22

Platform tested: Windows 2012 64(Python 2.7.11)

Redmine ticket header update:

Name Old Value New Value
Status changed In Testing Resolved
dpage commented 6 years ago

Comment migrated from Redmine: https://redmine.postgresql.org/issues/1404#note-14 Originally created by Fahar Abbas at 2018-01-09 04:27:35 UTC.

Redmine ticket header update:

Name Old Value New Value
Done Ratio changed 90 100
dpage commented 2 years ago

Issue closed on Redmine.