Fix editing of table data with a JSON primary key. Fixes #3912
parent
ccb0796317
commit
292ac32db5
|
@ -21,6 +21,7 @@ Bug fixes
|
||||||
| `Bug #3544 <https://redmine.postgresql.org/issues/3544>`_ - Make the Query Tool tab titles more concise and useful.
|
| `Bug #3544 <https://redmine.postgresql.org/issues/3544>`_ - Make the Query Tool tab titles more concise and useful.
|
||||||
| `Bug #3873 <https://redmine.postgresql.org/issues/3873>`_ - Fix context sub-menu alignment on Safari.
|
| `Bug #3873 <https://redmine.postgresql.org/issues/3873>`_ - Fix context sub-menu alignment on Safari.
|
||||||
| `Bug #3906 <https://redmine.postgresql.org/issues/3906>`_ - Fix alignment of Close and Maximize button of Grant Wizard.
|
| `Bug #3906 <https://redmine.postgresql.org/issues/3906>`_ - Fix alignment of Close and Maximize button of Grant Wizard.
|
||||||
|
| `Bug #3912 <https://redmine.postgresql.org/issues/3912>`_ - Fix editing of table data with a JSON primary key.
|
||||||
| `Bug #3942 <https://redmine.postgresql.org/issues/3942>`_ - Close connections gracefully when the user logs out of pgAdmin.
|
| `Bug #3942 <https://redmine.postgresql.org/issues/3942>`_ - Close connections gracefully when the user logs out of pgAdmin.
|
||||||
| `Bug #3946 <https://redmine.postgresql.org/issues/3946>`_ - Fix alignment of checkbox to drop multiple schedules of pgAgent job.
|
| `Bug #3946 <https://redmine.postgresql.org/issues/3946>`_ - Fix alignment of checkbox to drop multiple schedules of pgAgent job.
|
||||||
| `Bug #3959 <https://redmine.postgresql.org/issues/3959>`_ - Optimise display of Dependencies and Dependents, and use on-demand loading of rows in batches of 100.
|
| `Bug #3959 <https://redmine.postgresql.org/issues/3959>`_ - Optimise display of Dependencies and Dependents, and use on-demand loading of rows in batches of 100.
|
||||||
|
|
|
@ -18,6 +18,7 @@ from flask import session
|
||||||
from flask_babelex import gettext
|
from flask_babelex import gettext
|
||||||
import psycopg2
|
import psycopg2
|
||||||
from psycopg2.extensions import adapt
|
from psycopg2.extensions import adapt
|
||||||
|
from psycopg2.extras import Json as psycopg2_json
|
||||||
|
|
||||||
import config
|
import config
|
||||||
from pgadmin.model import Server, User
|
from pgadmin.model import Server, User
|
||||||
|
@ -225,6 +226,13 @@ class Driver(BaseDriver):
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def qtLiteral(value):
|
def qtLiteral(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)
|
adapted = adapt(value)
|
||||||
|
|
||||||
# Not all adapted objects have encoding
|
# Not all adapted objects have encoding
|
||||||
|
|
Loading…
Reference in New Issue