{"record":{"id":"712575976aa870c6","repo":"influxdata/influxdb","slug":"update-to-schema-would-exceed-number-of-tables-limit","errorCode":null,"errorMessage":"Update to schema would exceed number of tables limit: attempted to create table but already have {current} table(s) (limit: {limit})","messagePattern":"Update to schema would exceed number of tables limit: attempted to create table but already have (.+?) table\\(s\\) \\(limit: (.+?)\\)","errorType":"validation","errorClass":"CatalogError","httpStatus":400,"severity":"error","filePath":"influxdb3_catalog/src/error.rs","lineNumber":150,"sourceCode":"        proposed schema update would have {attempted} columns, but the limit is {limit}\"\n    )]\n    TooManyColumns {\n        table_name: TruncatedTableName,\n        attempted: usize,\n        limit: usize,\n    },\n\n    #[error(\n        \"Schema update for table '{table_name}' would exceed the tag column limit: \\\n        proposed schema would have {attempted} tag columns, but the limit is {limit}\"\n    )]\n    TooManyTagColumns {\n        table_name: TruncatedTableName,\n        attempted: usize,\n        limit: usize,\n    },\n\n    #[error(\n        \"Update to schema would exceed number of tables limit: attempted to create table but already have {current} table(s) (limit: {limit})\"\n    )]\n    TooManyTables { current: usize, limit: usize },\n\n    #[error(\"Adding a new database would exceed limit of {0} databases\")]\n    TooManyDbs(usize),\n\n    #[error(\n        \"Update to schema would exceed the field limit ({limit}) for field family '{field_family}'\"\n    )]\n    TooManyFields { field_family: String, limit: usize },\n\n    #[error(\"Update to schema would exceed the field family limit of {0}\")]\n    TooManyFieldFamilies(usize),\n\n    #[error(\n        \"table '{table_name}' in storage mode {storage_mode:?} cannot allocate more legacy column IDs\"\n    )]","sourceCodeStart":132,"sourceCodeEnd":168,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/influxdb3_catalog/src/error.rs#L132-L168","documentation":"Thrown when creating a table would exceed the maximum number of tables allowed in a database. The catalog tracks the current table count (`current`) and rejects the CREATE TABLE once it would exceed `limit`.","triggerScenarios":"CREATE TABLE (explicitly or implicitly via a line-protocol write that references a new measurement) when the database already holds `limit` tables.","commonSituations":"Auto-creating measurements from user-supplied metric names (spam via HTTP API); one-database-per-tenant designs with many tenants; migrations importing thousands of tables from other systems.","solutions":["Consolidate measurements: combine similar tables into one with a distinguishing tag","Delete unused tables (DROP TABLE) or archive old data to a separate database","Distribute tables across multiple databases","Raise the tables-per-database limit in server configuration if justified"],"exampleFix":"// before: one table per sensor type\nsensor_temp, sensor_humidity, sensor_pressure, ... (hundreds)\n// after: one table with a type tag\nsensor,location=us,type=temp value=72\nsensor,location=us,type=humidity value=60","handlingStrategy":"validation","validationCode":"const TABLE_LIMIT = 1000; // instance-configured\nconst { rows } = await db.query('SELECT count(*) AS n FROM information_schema.tables WHERE database = $1', [dbName]);\nif (Number(rows[0].n) >= TABLE_LIMIT) throw new Error(`table limit ${TABLE_LIMIT} reached`);","typeGuard":null,"tryCatchPattern":"try {\n  await catalog.createTable(db, name, schema);\n} catch (e) {\n  if (String(e.message).includes('number of tables limit')) {\n    // consolidate or switch database\n  } else throw e;\n}","preventionTips":["Never create tables from unvalidated user input (measurement names)","Prefer one table + discriminator tag over table-per-entity","Alert when a database's table count reaches ~80% of the limit"],"tags":["schema","table-limit","catalog","capacity"],"backgroundTag":"value-out-of-range","analyzedSha":"06200ef96ba82c5f6727e5038a83af8e722c6875","analyzedAt":"2026-09-19T12:55:30.003Z","contentChangedAt":"2026-09-19T12:55:30.003Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}