From e1b1afb2cf0e18e88f99b0211f553b9f74facd39 Mon Sep 17 00:00:00 2001 From: Christophe Siraut Date: Tue, 28 Jan 2020 10:58:04 +0100 Subject: [PATCH] set application_name to tenant name (#7849) --- tenant_schemas/postgresql_backend/base.py | 1 + 1 file changed, 1 insertion(+) 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: