{"record":{"id":"63532221b5fe5bc6","repo":"risingwavelabs/risingwave","slug":"table-table-name-does-not-exist","errorCode":null,"errorMessage":"table \"{table_name}\" does not exist","messagePattern":"table \"(.+?)\" does not exist","errorType":"validation","errorClass":"InvalidInput","httpStatus":null,"severity":"error","filePath":"src/frontend/src/session.rs","lineNumber":1294,"sourceCode":"    }\n\n    pub fn get_table_by_id(&self, table_id: TableId) -> Result<Arc<TableCatalog>> {\n        let catalog_reader = self.env().catalog_reader().read_guard();\n        Ok(catalog_reader.get_any_table_by_id(table_id)?.clone())\n    }\n\n    pub fn get_table_by_name(\n        &self,\n        table_name: &str,\n        db_id: DatabaseId,\n        schema_id: SchemaId,\n    ) -> Result<Arc<TableCatalog>> {\n        let catalog_reader = self.env().catalog_reader().read_guard();\n        let table = catalog_reader\n            .get_schema_by_id(db_id, schema_id)?\n            .get_created_table_by_name(table_name)\n            .ok_or_else(|| {\n                Error::new(\n                    ErrorKind::InvalidInput,\n                    format!(\"table \\\"{}\\\" does not exist\", table_name),\n                )\n            })?;\n\n        self.check_privileges(&[ObjectCheckItem::new(\n            table.owner(),\n            AclMode::Select,\n            table_name.to_owned(),\n            table.id,\n        )])?;\n\n        Ok(table.clone())\n    }\n\n    pub fn get_secret_by_name(\n        &self,\n        schema_name: Option<String>,","sourceCodeStart":1276,"sourceCodeEnd":1312,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/frontend/src/session.rs#L1276-L1312","documentation":"Session::get_table (catalog access path) resolves a table by name within a schema and returns an eyelevel InvalidInput error when no created table with that name exists. It is the user-facing \"table does not exist\" error, raised before privilege checks run.","triggerScenarios":"Calling APIs that fetch a TableCatalog by table_name for a given db_id/schema_id when get_created_table_by_name returns None: querying or altering a table that was never created, was dropped, or exists only as a source/view/index.","commonSituations":"Typo or wrong case in the table name; table dropped by another session; object is a source or MV, not a table; connecting to the wrong database; webhook/HTTP APIs referencing a table name that doesn't exist.","solutions":["Run SHOW TABLES IN <schema> to list exact table names.","Fully qualify and quote the identifier: SELECT * FROM \"db\".\"schema\".\"table\".","Verify the object exists in rw_catalog.rw_tables; if it's an MV/source, query it via the correct statement type.","Recreate the table if it was dropped, or point the client at the correct database."],"exampleFix":"// before\nlet t = session.get_table(db_id, schema_id, \"Orderes\").await?; // typo\n\n// after\nlet t = session.get_table(db_id, schema_id, \"Orders\").await?;","handlingStrategy":"validation","validationCode":"-- before get_table\nlet exists = catalog_reader.get_schema_by_id(db_id, schema_id)?\n    .get_created_table_by_name(table_name).is_some();\nif !exists { return Err(...); }","typeGuard":null,"tryCatchPattern":"match session.get_table(db_id, schema_id, name).await {\n    Ok(t) => t,\n    Err(e) if e.to_string().contains(\"does not exist\") => {\n        create_or_recreate_table(name).await?;\n        session.get_table(db_id, schema_id, name).await?\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Run SHOW TABLES before querying in scripts and CI.","Use exact case-matched, quoted table names from catalog listings.","Remember MVs/sources are not tables for this API — pick the right accessor.","Handle concurrent DDL: re-check existence after 'does not exist' errors."],"tags":["catalog","table-not-found","sql","frontend"],"backgroundTag":"table-not-found","analyzedSha":"6469eb736d691e8e9b8a419a57edd6429ca77417","analyzedAt":"2026-09-11T21:06:21.487Z","contentChangedAt":"2026-09-11T21:06:21.487Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}