summaryrefslogtreecommitdiff
path: root/django/db/backends/postgresql/operations.py
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2010-04-29 01:22:50 +0000
committerRussell Keith-Magee <russell@keith-magee.com>2010-04-29 01:22:50 +0000
commit60df7421f6ebc9f309ba05cbc20ca13b60411e22 (patch)
tree2c9482b76265ae1d7d0cafb11e348c1b556cf972 /django/db/backends/postgresql/operations.py
parent6a1cf9369fceba9833f7ad8702ebef80dc98291e (diff)
downloaddjango-60df7421f6ebc9f309ba05cbc20ca13b60411e22.tar.gz
Fixed #13441 -- Enforced a maximum identifier length of 63 for PostgreSQL. Thanks to aball for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13044 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/db/backends/postgresql/operations.py')
-rw-r--r--django/db/backends/postgresql/operations.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/django/db/backends/postgresql/operations.py b/django/db/backends/postgresql/operations.py
index f51743646d..2951c33db9 100644
--- a/django/db/backends/postgresql/operations.py
+++ b/django/db/backends/postgresql/operations.py
@@ -163,3 +163,17 @@ class DatabaseOperations(BaseDatabaseOperations):
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)
+
+ def max_name_length(self):
+ """
+ Returns the maximum length of an identifier.
+
+ Note that the maximum length of an identifier is 63 by default, but can
+ be changed by recompiling PostgreSQL after editing the NAMEDATALEN
+ macro in src/include/pg_config_manual.h .
+
+ This implementation simply returns 63, but can easily be overridden by a
+ custom database backend that inherits most of its behavior from this one.
+ """
+
+ return 63