From 9e3bfff68d35a2eb21ba43452fc01ee24601c122 Mon Sep 17 00:00:00 2001 From: Guillaume Jacquart Date: Mon, 28 Jul 2025 12:30:21 +0200 Subject: [PATCH] fix(core): Fix getLiveExecutionRowsOnPostgres when there are multiple n8n schemas (#17635) --- packages/@n8n/db/src/repositories/execution.repository.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@n8n/db/src/repositories/execution.repository.ts b/packages/@n8n/db/src/repositories/execution.repository.ts index 94ba8b6295..22b0bbc19b 100644 --- a/packages/@n8n/db/src/repositories/execution.repository.ts +++ b/packages/@n8n/db/src/repositories/execution.repository.ts @@ -922,7 +922,7 @@ export class ExecutionRepository extends Repository { async getLiveExecutionRowsOnPostgres() { const tableName = `${this.globalConfig.database.tablePrefix}execution_entity`; - const pgSql = `SELECT n_live_tup as result FROM pg_stat_all_tables WHERE relname = '${tableName}';`; + const pgSql = `SELECT n_live_tup as result FROM pg_stat_all_tables WHERE relname = '${tableName}' and schemaname = '${this.globalConfig.database.postgresdb.schema}';`; try { const rows = (await this.query(pgSql)) as Array<{ result: string }>;