summaryrefslogtreecommitdiff
path: root/django/db/backends/postgresql/base.py
diff options
context:
space:
mode:
authorJon Dufresne <jon.dufresne@gmail.com>2018-08-17 09:43:56 -0700
committerTim Graham <timograham@gmail.com>2018-08-17 12:43:56 -0400
commitbf17f5e88466e3f571065345f5b2fea0d8af89fe (patch)
tree5da4db7ea72275bb6642a0b662cea5258fc8908c /django/db/backends/postgresql/base.py
parent09ee3b6fe3c4d80bb445835f88148d6f48cde3ff (diff)
downloaddjango-bf17f5e88466e3f571065345f5b2fea0d8af89fe.tar.gz
Refs #29015 -- Added database name to PostgreSQL database name too long exception.
Diffstat (limited to 'django/db/backends/postgresql/base.py')
-rw-r--r--django/db/backends/postgresql/base.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/django/db/backends/postgresql/base.py b/django/db/backends/postgresql/base.py
index 025981c1e5..ad6c504261 100644
--- a/django/db/backends/postgresql/base.py
+++ b/django/db/backends/postgresql/base.py
@@ -151,9 +151,13 @@ class DatabaseWrapper(BaseDatabaseWrapper):
"Please supply the NAME value.")
if len(settings_dict['NAME'] or '') > self.ops.max_name_length():
raise ImproperlyConfigured(
- 'Database names longer than %d characters are not supported by '
- 'PostgreSQL. Supply a shorter NAME in settings.DATABASES.'
- % self.ops.max_name_length()
+ "The database name '%s' (%d characters) is longer than "
+ "PostgreSQL's limit of %d characters. Supply a shorter NAME "
+ "in settings.DATABASES." % (
+ settings_dict['NAME'],
+ len(settings_dict['NAME']),
+ self.ops.max_name_length(),
+ )
)
conn_params = {
'database': settings_dict['NAME'] or 'postgres',