diff --git a/docs/en_US/release_notes_4_5.rst b/docs/en_US/release_notes_4_5.rst index 8d6a7531f..6f61d91dd 100644 --- a/docs/en_US/release_notes_4_5.rst +++ b/docs/en_US/release_notes_4_5.rst @@ -2,7 +2,7 @@ Version 4.5 *********** -Release date: 2019-05-02 +Release date: 2019-04-10 This release contains a number of new features and fixes reported since the release of pgAdmin4 4.4. @@ -15,5 +15,8 @@ Features Bug fixes ********* +| `Bug #2214 `_ - Fixed 'Change Password' issue for SCRAM authentication. +| `Bug #3656 `_ - Ensure that two consecutive SELECT statements should work properly. | `Bug #4131 `_ - Relabel the Save button on the datagrid text editor to avoid confusion with the actual Save button that updates the database. -| `Bug #4142 `_ - Added recommended ESLinter checks. \ No newline at end of file +| `Bug #4142 `_ - Added recommended ESLinter checks. +| `Bug #4143 `_ - Ensure that pgAdmin4 should work properly with psycopg2 v2.8 \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 7e37673e0..090c279f1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -21,7 +21,7 @@ sqlparse==0.2.4 WTForms==2.2.1 Flask-Paranoid==0.2.0 psutil==5.5.1 -psycopg2>=2.7.7 +psycopg2>=2.8 python-dateutil>=2.8.0 htmlmin==0.1.12 Flask-HTMLmin==1.5.0 diff --git a/web/pgadmin/utils/driver/psycopg2/cursor.py b/web/pgadmin/utils/driver/psycopg2/cursor.py index d78ab4b05..1e9f545e1 100644 --- a/web/pgadmin/utils/driver/psycopg2/cursor.py +++ b/web/pgadmin/utils/driver/psycopg2/cursor.py @@ -18,6 +18,8 @@ try: except ImportError: from ordereddict import OrderedDict +import psycopg2 + from psycopg2.extensions import cursor as _cursor, encodings from .encoding import configureDriverEncodings @@ -91,7 +93,25 @@ class _WrapperColumn(object): Generates an OrderedDict from the fields of the original objects with avoiding the duplicate name. """ - ores = OrderedDict(self.orig_col._asdict()) + + # In psycopg2 2.8, the description of one result column, + # exposed as items of the cursor.description sequence. + # Before psycopg2 2.8 the description attribute was a sequence + # of simple tuples or namedtuples. + if psycopg2.__version__.find('2.8') != -1: + ores = OrderedDict() + ores['name'] = self.orig_col.name + ores['type_code'] = self.orig_col.type_code + ores['display_size'] = self.orig_col.display_size + ores['internal_size'] = self.orig_col.internal_size + ores['precision'] = self.orig_col.precision + ores['scale'] = self.orig_col.scale + ores['null_ok'] = self.orig_col.null_ok + ores['table_oid'] = self.orig_col.table_oid + ores['table_column'] = self.orig_col.table_column + else: + ores = OrderedDict(self.orig_col._asdict()) + name = ores['name'] if self.dummy_name: ores['name'] = self.dummy_name