summaryrefslogtreecommitdiff
path: root/django/db/backends/postgresql_psycopg2
diff options
context:
space:
mode:
Diffstat (limited to 'django/db/backends/postgresql_psycopg2')
-rw-r--r--django/db/backends/postgresql_psycopg2/base.py15
1 files changed, 5 insertions, 10 deletions
diff --git a/django/db/backends/postgresql_psycopg2/base.py b/django/db/backends/postgresql_psycopg2/base.py
index 87b41877a6..0bcfd46ac4 100644
--- a/django/db/backends/postgresql_psycopg2/base.py
+++ b/django/db/backends/postgresql_psycopg2/base.py
@@ -4,7 +4,7 @@ PostgreSQL database backend for Django.
Requires psycopg 2: http://initd.org/projects/psycopg2
"""
-from django.db.backends import BaseDatabaseWrapper
+from django.db.backends import BaseDatabaseWrapper, BaseDatabaseFeatures
from django.db.backends.postgresql.operations import DatabaseOperations
try:
import psycopg2 as Database
@@ -18,7 +18,11 @@ IntegrityError = Database.IntegrityError
psycopg2.extensions.register_type(psycopg2.extensions.UNICODE)
+class DatabaseFeatures(BaseDatabaseFeatures):
+ needs_datetime_string_cast = False
+
class DatabaseWrapper(BaseDatabaseWrapper):
+ features = DatabaseFeatures()
ops = DatabaseOperations()
def _cursor(self, settings):
@@ -49,15 +53,6 @@ class DatabaseWrapper(BaseDatabaseWrapper):
self.ops.postgres_version = [int(val) for val in cursor.fetchone()[0].split()[1].split('.')]
return cursor
-allows_group_by_ordinal = True
-allows_unique_and_pk = True
-autoindexes_primary_keys = True
-needs_datetime_string_cast = False
-needs_upper_for_iops = False
-supports_constraints = True
-supports_tablespaces = False
-uses_case_insensitive_names = False
-
OPERATOR_MAPPING = {
'exact': '= %s',
'iexact': 'ILIKE %s',