influxdata/influxdb · error · CatalogError
Update to schema would exceed number of tables limit…
Error message
Update to schema would exceed number of tables limit: attempted to create table but already have {current} table(s) (limit: {limit}) What it means
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`.
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
Example fix
// before: one table per sensor type sensor_temp, sensor_humidity, sensor_pressure, ... (hundreds) // after: one table with a type tag sensor,location=us,type=temp value=72 sensor,location=us,type=humidity value=60
Defensive patterns
Strategy: validation
Validate before calling
const TABLE_LIMIT = 1000; // instance-configured
const { rows } = await db.query('SELECT count(*) AS n FROM information_schema.tables WHERE database = $1', [dbName]);
if (Number(rows[0].n) >= TABLE_LIMIT) throw new Error(`table limit ${TABLE_LIMIT} reached`); Try / catch
try {
await catalog.createTable(db, name, schema);
} catch (e) {
if (String(e.message).includes('number of tables limit')) {
// consolidate or switch database
} else throw e;
} Prevention
- 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
When it happens
Trigger: CREATE TABLE (explicitly or implicitly via a line-protocol write that references a new measurement) when the database already holds `limit` tables.
Common situations: 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.
Understand the failure class
Background: "value must be between 0 and 1" / "out of range" / "must not be negative" errors: fixing range-validation failures across open-source libraries — this error's family across 42 libraries.
Related errors
- Adding a new database would exceed limit of
- cannot add column because it already exists with type
- column id in series key should be valid
- Field type mismatch on table
- Schema update for table
AI-assisted analysis of influxdata/influxdb@06200ef96b (2026-09-19).
Data as JSON: /api/errors/712575976aa870c6.
Report an issue: GitHub.
Appendix: source
Thrown at influxdb3_catalog/src/error.rs:150
proposed schema update would have {attempted} columns, but the limit is {limit}"
)]
TooManyColumns {
table_name: TruncatedTableName,
attempted: usize,
limit: usize,
},
#[error(
"Schema update for table '{table_name}' would exceed the tag column limit: \
proposed schema would have {attempted} tag columns, but the limit is {limit}"
)]
TooManyTagColumns {
table_name: TruncatedTableName,
attempted: usize,
limit: usize,
},
#[error(
"Update to schema would exceed number of tables limit: attempted to create table but already have {current} table(s) (limit: {limit})"
)]
TooManyTables { current: usize, limit: usize },
#[error("Adding a new database would exceed limit of {0} databases")]
TooManyDbs(usize),
#[error(
"Update to schema would exceed the field limit ({limit}) for field family '{field_family}'"
)]
TooManyFields { field_family: String, limit: usize },
#[error("Update to schema would exceed the field family limit of {0}")]
TooManyFieldFamilies(usize),
#[error(
"table '{table_name}' in storage mode {storage_mode:?} cannot allocate more legacy column IDs"
)]View on GitHub (pinned to 06200ef96b)