diff options
author | Aymeric Augustin <aymeric.augustin@m4x.org> | 2013-03-17 11:45:45 +0100 |
---|---|---|
committer | Aymeric Augustin <aymeric.augustin@m4x.org> | 2013-03-18 21:16:29 +0100 |
commit | 6197935152419f064911f7a26b70da32f31435c7 (patch) | |
tree | 21265a7c5da3fcf5a396b31bca9bdd36a4652951 /django/db/backends/postgresql_psycopg2/operations.py | |
parent | 9dc5702932a0031bc4fb5473f2cdccffc61dbe30 (diff) | |
download | django-6197935152419f064911f7a26b70da32f31435c7.tar.gz |
Fixed #19968 -- Dropped support for PostgreSQL < 8.4.
Diffstat (limited to 'django/db/backends/postgresql_psycopg2/operations.py')
-rw-r--r-- | django/db/backends/postgresql_psycopg2/operations.py | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/django/db/backends/postgresql_psycopg2/operations.py b/django/db/backends/postgresql_psycopg2/operations.py index a210f87ccd..b17a0c17bb 100644 --- a/django/db/backends/postgresql_psycopg2/operations.py +++ b/django/db/backends/postgresql_psycopg2/operations.py @@ -9,7 +9,7 @@ class DatabaseOperations(BaseDatabaseOperations): super(DatabaseOperations, self).__init__(connection) def date_extract_sql(self, lookup_type, field_name): - # http://www.postgresql.org/docs/8.0/static/functions-datetime.html#FUNCTIONS-DATETIME-EXTRACT + # http://www.postgresql.org/docs/current/static/functions-datetime.html#FUNCTIONS-DATETIME-EXTRACT if lookup_type == 'week_day': # For consistency across backends, we return Sunday=1, Saturday=7. return "EXTRACT('dow' FROM %s) + 1" % field_name @@ -34,7 +34,7 @@ class DatabaseOperations(BaseDatabaseOperations): return '(%s)' % conn.join([sql, 'interval \'%s\'' % mods]) def date_trunc_sql(self, lookup_type, field_name): - # http://www.postgresql.org/docs/8.0/static/functions-datetime.html#FUNCTIONS-DATETIME-TRUNC + # http://www.postgresql.org/docs/current/static/functions-datetime.html#FUNCTIONS-DATETIME-TRUNC return "DATE_TRUNC('%s', %s)" % (lookup_type, field_name) def datetime_extract_sql(self, lookup_type, field_name, tzname): @@ -43,7 +43,7 @@ class DatabaseOperations(BaseDatabaseOperations): params = [tzname] else: params = [] - # http://www.postgresql.org/docs/8.0/static/functions-datetime.html#FUNCTIONS-DATETIME-EXTRACT + # http://www.postgresql.org/docs/current/static/functions-datetime.html#FUNCTIONS-DATETIME-EXTRACT if lookup_type == 'week_day': # For consistency across backends, we return Sunday=1, Saturday=7. sql = "EXTRACT('dow' FROM %s) + 1" % field_name @@ -57,7 +57,7 @@ class DatabaseOperations(BaseDatabaseOperations): params = [tzname] else: params = [] - # http://www.postgresql.org/docs/8.0/static/functions-datetime.html#FUNCTIONS-DATETIME-TRUNC + # http://www.postgresql.org/docs/current/static/functions-datetime.html#FUNCTIONS-DATETIME-TRUNC sql = "DATE_TRUNC('%s', %s)" % (lookup_type, field_name) return sql, params @@ -178,17 +178,6 @@ class DatabaseOperations(BaseDatabaseOperations): def prep_for_iexact_query(self, x): return x - def check_aggregate_support(self, aggregate): - """Check that the backend fully supports the provided aggregate. - - The implementation of population statistics (STDDEV_POP and VAR_POP) - under Postgres 8.2 - 8.2.4 is known to be faulty. Raise - NotImplementedError if this is the database in use. - """ - if aggregate.sql_function in ('STDDEV_POP', 'VAR_POP'): - 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): """ Returns the maximum length of an identifier. |