summaryrefslogtreecommitdiff
path: root/django/db/backends/postgresql/operations.py
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2009-05-11 01:46:26 +0000
committerRussell Keith-Magee <russell@keith-magee.com>2009-05-11 01:46:26 +0000
commit4f9fd449658132362c8274e1fec96df5e843cf05 (patch)
treeaf6b0574b649b67cbbd4dcdfe27927c091f4fefd /django/db/backends/postgresql/operations.py
parentfe971ec66f5d42945b2583037303be31f53ea524 (diff)
downloaddjango-4f9fd449658132362c8274e1fec96df5e843cf05.tar.gz
Corrected PostgreSQL version comparisons from r10730. Thanks to rozwell for the report on IRC.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10735 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/db/backends/postgresql/operations.py')
-rw-r--r--django/db/backends/postgresql/operations.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/django/db/backends/postgresql/operations.py b/django/db/backends/postgresql/operations.py
index 593fb6ad74..ee74be1624 100644
--- a/django/db/backends/postgresql/operations.py
+++ b/django/db/backends/postgresql/operations.py
@@ -66,7 +66,7 @@ class DatabaseOperations(BaseDatabaseOperations):
def sql_flush(self, style, tables, sequences):
if tables:
- if self.postgres_version[0:2] >= [8,1]:
+ if self.postgres_version[0:2] >= (8,1):
# Postgres 8.1+ can do 'TRUNCATE x, y, z...;'. In fact, it *has to*
# in order to be able to truncate tables referenced by a foreign
# key in any other table. The result is a single SQL TRUNCATE
@@ -154,10 +154,10 @@ class DatabaseOperations(BaseDatabaseOperations):
NotImplementedError if this is the database in use.
"""
if aggregate.sql_function in ('STDDEV_POP', 'STDDEV_SAMP', 'VAR_POP', 'VAR_SAMP'):
- if self.postgres_version[0:2] < [8,2]:
+ if self.postgres_version[0:2] < (8,2):
raise NotImplementedError('PostgreSQL does not support %s prior to version 8.2. Please upgrade your version of PostgreSQL.' % aggregate.sql_function)
if aggregate.sql_function in ('STDDEV_POP', 'VAR_POP'):
- if self.postgres_version[0:2] == [8,2]:
+ if self.postgres_version[0:2] == (8,2):
if self.postgres_version[2] is None or self.postgres_version[2] <= 4:
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)