diff options
author | Aymeric Augustin <aymeric.augustin@m4x.org> | 2013-02-19 10:51:24 +0100 |
---|---|---|
committer | Aymeric Augustin <aymeric.augustin@m4x.org> | 2013-02-19 10:51:24 +0100 |
commit | ebabd772911f732ef54e014f130f6f5530198e14 (patch) | |
tree | 47277e0499da8d38d3100bb5724d9753d833b1f3 /django/db/backends/postgresql_psycopg2/operations.py | |
parent | 9a3988ca5ad5808fad0d5bd8e25fe560d0d48ec0 (diff) | |
download | django-ebabd772911f732ef54e014f130f6f5530198e14.tar.gz |
Ensured a connection is established when checking the database version.
Fixed a test broken by 21765c0a. Refs #18135.
Diffstat (limited to 'django/db/backends/postgresql_psycopg2/operations.py')
-rw-r--r-- | django/db/backends/postgresql_psycopg2/operations.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/django/db/backends/postgresql_psycopg2/operations.py b/django/db/backends/postgresql_psycopg2/operations.py index 8e87ed539f..56535e0865 100644 --- a/django/db/backends/postgresql_psycopg2/operations.py +++ b/django/db/backends/postgresql_psycopg2/operations.py @@ -195,8 +195,7 @@ class DatabaseOperations(BaseDatabaseOperations): NotImplementedError if this is the database in use. """ if aggregate.sql_function in ('STDDEV_POP', 'VAR_POP'): - pg_version = self.connection.pg_version - if pg_version >= 80200 and pg_version <= 80204: + if 80200 <= self.connection.pg_version <= 80204: raise NotImplementedError('PostgreSQL 8.2 to 8.2.4 is known to have a faulty implementation of %s. Please upgrade your version of PostgreSQL.' % aggregate.sql_function) def max_name_length(self): |