diff --git a/packages/nocodb/src/lib/meta/api/columnApis.ts b/packages/nocodb/src/lib/meta/api/columnApis.ts index b99f7a5cba..d2cf932860 100644 --- a/packages/nocodb/src/lib/meta/api/columnApis.ts +++ b/packages/nocodb/src/lib/meta/api/columnApis.ts @@ -652,8 +652,21 @@ export async function columnUpdate(req: Request, res: Response) { const table = await Model.getWithInfo({ id: column.fk_model_id, }); + const base = await Base.get(table.base_id); + const dbDriver = NcConnectionMgrv2.get(base); + + const sqlClientType = dbDriver.clientType(); + + const mxColumnLength = Column.getMaxColumnNameLength(sqlClientType); + + if (req.body.column_name.length > mxColumnLength) { + NcError.badRequest( + `Column name ${req.body.column_name} exceeds ${mxColumnLength} characters` + ); + } + if ( !isVirtualCol(req.body) && !(await Column.checkTitleAvailable({