diff options
author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2019-04-05 11:05:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-05 11:05:53 +0200 |
commit | 5efaf078f7609a8c95045bcfdab0ba256b5449bf (patch) | |
tree | 2cd290d0d61961eb934a3a03dd927de09305969b /django/db/backends/postgresql/introspection.py | |
parent | 755673e1bca7edb6bee7a958f40d9ae54d85d44c (diff) | |
download | django-5efaf078f7609a8c95045bcfdab0ba256b5449bf.tar.gz |
Fixed #30331 -- Added support for psycopg2 2.8.
Diffstat (limited to 'django/db/backends/postgresql/introspection.py')
-rw-r--r-- | django/db/backends/postgresql/introspection.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/django/db/backends/postgresql/introspection.py b/django/db/backends/postgresql/introspection.py index 3ce88ccfbf..9bd75bd847 100644 --- a/django/db/backends/postgresql/introspection.py +++ b/django/db/backends/postgresql/introspection.py @@ -77,7 +77,18 @@ class DatabaseIntrospection(BaseDatabaseIntrospection): """, [table_name]) field_map = {line[0]: line[1:] for line in cursor.fetchall()} cursor.execute("SELECT * FROM %s LIMIT 1" % self.connection.ops.quote_name(table_name)) - return [FieldInfo(*line[0:6], *field_map[line.name]) for line in cursor.description] + return [ + FieldInfo( + line.name, + line.type_code, + line.display_size, + line.internal_size, + line.precision, + line.scale, + *field_map[line.name], + ) + for line in cursor.description + ] def get_sequences(self, cursor, table_name, table_fields=()): cursor.execute(""" |