diff --git a/tenant_schemas/postgresql_backend/base.py b/tenant_schemas/postgresql_backend/base.py index a77ff6a..f927d9f 100644 --- a/tenant_schemas/postgresql_backend/base.py +++ b/tenant_schemas/postgresql_backend/base.py @@ -154,6 +154,7 @@ class DatabaseWrapper(original_backend.DatabaseWrapper): # we do not have to worry that it's not the good one try: cursor_for_search_path.execute('SET search_path = {0}'.format(','.join(search_paths))) + cursor_for_search_path.execute('SET application_name = {0}'.format(self.schema_name)) except (django.db.utils.DatabaseError, psycopg2.InternalError): self.search_path_set = False else: