diff --git a/docs/en_US/release_notes_4_3.rst b/docs/en_US/release_notes_4_3.rst index 1f3a3bd53..2ad2e44b6 100644 --- a/docs/en_US/release_notes_4_3.rst +++ b/docs/en_US/release_notes_4_3.rst @@ -21,6 +21,7 @@ Bug fixes | `Bug #3544 `_ - Make the Query Tool tab titles more concise and useful. | `Bug #3873 `_ - Fix context sub-menu alignment on Safari. | `Bug #3906 `_ - Fix alignment of Close and Maximize button of Grant Wizard. +| `Bug #3912 `_ - Fix editing of table data with a JSON primary key. | `Bug #3942 `_ - Close connections gracefully when the user logs out of pgAdmin. | `Bug #3946 `_ - Fix alignment of checkbox to drop multiple schedules of pgAgent job. | `Bug #3959 `_ - Optimise display of Dependencies and Dependents, and use on-demand loading of rows in batches of 100. diff --git a/web/pgadmin/utils/driver/psycopg2/__init__.py b/web/pgadmin/utils/driver/psycopg2/__init__.py index c63c35e46..2b6ed6de5 100644 --- a/web/pgadmin/utils/driver/psycopg2/__init__.py +++ b/web/pgadmin/utils/driver/psycopg2/__init__.py @@ -18,6 +18,7 @@ from flask import session from flask_babelex import gettext import psycopg2 from psycopg2.extensions import adapt +from psycopg2.extras import Json as psycopg2_json import config from pgadmin.model import Server, User @@ -225,7 +226,14 @@ class Driver(BaseDriver): @staticmethod def qtLiteral(value): - adapted = adapt(value) + adapted = None + + # adapt function cannot adapt dict data type + # Used http://initd.org/psycopg/docs/extras.html#json-adaptation + if type(value) == dict: + adapted = psycopg2_json(value) + else: + adapted = adapt(value) # Not all adapted objects have encoding # e.g.