From 7f192a2266668380ca723d7e250593fb59b2584b Mon Sep 17 00:00:00 2001 From: Pranav C Date: Wed, 17 Jan 2024 06:57:50 +0000 Subject: [PATCH] fix: pg - make larst arg optional for sustr function --- packages/nocodb/src/db/functionMappings/pg.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nocodb/src/db/functionMappings/pg.ts b/packages/nocodb/src/db/functionMappings/pg.ts index 5b36f24282..3e1c95a820 100644 --- a/packages/nocodb/src/db/functionMappings/pg.ts +++ b/packages/nocodb/src/db/functionMappings/pg.ts @@ -210,7 +210,7 @@ const pg = { SUBSTR: async ({ fn, knex, pt, colAlias }: MapFnArgs) => { const str = (await fn(pt.arguments[0])).builder; const positionFrom = (await fn(pt.arguments[1] ?? 1)).builder; - const numberOfCharacters = (await fn(pt.arguments[2] ?? '')).builder; + const numberOfCharacters = pt.arguments[2] ? (await fn(pt.arguments[2])).builder : null; return { builder: knex.raw( `SUBSTR(${str}::TEXT, ${positionFrom}${