diff options
Diffstat (limited to 'django/db/backends/postgresql/base.py')
| -rw-r--r-- | django/db/backends/postgresql/base.py | 10 |
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', |
