From ebabd772911f732ef54e014f130f6f5530198e14 Mon Sep 17 00:00:00 2001 From: Aymeric Augustin Date: Tue, 19 Feb 2013 10:51:24 +0100 Subject: Ensured a connection is established when checking the database version. Fixed a test broken by 21765c0a. Refs #18135. --- django/db/backends/postgresql_psycopg2/operations.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'django/db/backends/postgresql_psycopg2/operations.py') 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): -- cgit v1.2.1