diff --git a/packages/nodes-base/nodes/Postgres/PostgresTrigger.node.ts b/packages/nodes-base/nodes/Postgres/PostgresTrigger.node.ts index e5a2891cb4..46d3c787a5 100644 --- a/packages/nodes-base/nodes/Postgres/PostgresTrigger.node.ts +++ b/packages/nodes-base/nodes/Postgres/PostgresTrigger.node.ts @@ -237,7 +237,7 @@ export class PostgresTrigger implements INodeType { this.emit([this.helpers.returnJsonArray([data])]); }; - // create trigger, funstion and channel or use existing channel + // create trigger, function and channel or use existing channel const pgNames = prepareNames(this.getNode().id, this.getMode(), additionalFields); if (triggerMode === 'createTrigger') { await pgTriggerFunction.call( @@ -284,7 +284,7 @@ export class PostgresTrigger implements INodeType { `Postgres Trigger Error: ${(error as Error).message}`, ); } finally { - await db.$pool.end(); + if (!db.$pool.ending) await db.$pool.end(); } }; diff --git a/packages/nodes-base/nodes/Postgres/v2/actions/router.ts b/packages/nodes-base/nodes/Postgres/v2/actions/router.ts index 38a03edf7e..60d780ce0e 100644 --- a/packages/nodes-base/nodes/Postgres/v2/actions/router.ts +++ b/packages/nodes-base/nodes/Postgres/v2/actions/router.ts @@ -58,7 +58,7 @@ export async function router(this: IExecuteFunctions): Promise { @@ -54,6 +54,6 @@ export async function tableSearch(this: ILoadOptionsFunctions): Promise