{"record":{"id":"fc76aa0339bb01ff","repo":"influxdata/influxdb","slug":"table-table-name-not-in-db-schema-for-db-name","errorCode":null,"errorMessage":"Table {table_name} not in DB schema for {db_name}","messagePattern":"Table (.+?) not in DB schema for (.+?)","errorType":"validation","errorClass":"CatalogError","httpStatus":404,"severity":"error","filePath":"influxdb3_catalog/src/error.rs","lineNumber":177,"sourceCode":"        \"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    )]\n    LegacyColumnIdsExhausted {\n        table_name: Arc<str>,\n        storage_mode: StorageMode,\n    },\n\n    #[error(\"Database not found {}\", db_name)]\n    DatabaseNotFound { db_name: Arc<str> },\n\n    #[error(\"Table {} not in DB schema for {}\", table_name, db_name)]\n    TableNotFound {\n        db_name: Arc<str>,\n        table_name: Arc<str>,\n    },\n\n    #[error(\n        \"Field type mismatch on table {} column {}. Existing column is {} but attempted to add {}\",\n        table_name,\n        column_name,\n        existing,\n        attempted\n    )]\n    FieldTypeMismatch {\n        table_name: String,\n        column_name: String,\n        existing: InfluxColumnType,\n        attempted: InfluxColumnType,\n    },","sourceCodeStart":159,"sourceCodeEnd":195,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/influxdb3_catalog/src/error.rs#L159-L195","documentation":"Thrown when an operation references a table that does not exist in the given database's schema. The catalog found the database (`db_name`) but no table named `table_name` within it, so the query/write/DDL is rejected.","triggerScenarios":"SELECT/DROP/ALTER on a misspelled or deleted table; a write targeting a table (measurement) in the wrong database; implicit table creation disabled while writing to a new measurement name.","commonSituations":"Pointing a client at a different database than where the table lives; table dropped by cleanup; renaming a measurement without updating downstream queries; case-sensitivity mismatches.","solutions":["Confirm the table exists in that specific database: SHOW TABLES (or information_schema)","Fix the table/measurement name in the query or write (watch casing and typos)","Create the table explicitly (CREATE TABLE) if implicit creation is not enabled","Check whether the table was deleted and restore/recreate it if needed"],"exampleFix":"// before: querying table in wrong DB\nSELECT * FROM \"cpu\" -- executed on db 'logs'\n// after: use the database that owns the table\nSELECT * FROM \"metrics\".\"cpu\"","handlingStrategy":"validation","validationCode":"const tables = await client.getTables(dbName);\nif (!tables.includes(tableName)) throw new Error(`table '${tableName}' missing in '${dbName}'`);","typeGuard":"function tableExists(t: string | null | undefined): t is string { return typeof t === 'string' && knownTables(t).length > 0; }","tryCatchPattern":"try {\n  return await client.query(`SELECT * FROM \"${db}\".\"${table}\"`);\n} catch (e) {\n  if (/Table .* not in DB schema/.test(String(e.message))) {\n    return []; // or create the table / redirect to correct db\n  } throw e;\n}","preventionTips":["Qualify queries with both database and table names explicitly","Treat measurement renames as breaking changes; update all clients in lockstep","For optional writes, enable implicit table creation or create tables via migration scripts"],"tags":["table","not-found","catalog","schema"],"backgroundTag":"entity-not-found","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"}