Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed #13441 -- Enforced a maximum identifier length of 63 for Postgr…

…eSQL. Thanks to aball for the report and patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@13044 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 60df7421f6ebc9f309ba05cbc20ca13b60411e22 1 parent 6a1cf93
@freakboy3742 freakboy3742 authored
Showing with 14 additions and 0 deletions.
  1. +14 −0 django/db/backends/postgresql/operations.py
View
14 django/db/backends/postgresql/operations.py
@@ -163,3 +163,17 @@ def check_aggregate_support(self, aggregate):
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
Please sign in to comment.
Something went wrong with that request. Please try again.