{"record":{"id":"3f63ed921e1522d0","repo":"apache/seatunnel","slug":"can-t-obtain-schema-for-table-tableid","errorCode":null,"errorMessage":"Can't obtain schema for table ${tableId} ","messagePattern":"Can't obtain schema for table (.+?) ","errorType":"exception","errorClass":"SeaTunnelException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-cdc/connector-cdc-postgres/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/postgres/utils/PostgresSchema.java","lineNumber":90,"sourceCode":"            for (TableId id : tables.tableIds()) {\n                TableId idWithCatalog = new TableId(tableId.catalog(), id.schema(), id.table());\n                if (tableMap.containsKey(idWithCatalog)) {\n                    Table table =\n                            CatalogTableUtils.mergeCatalogTableConfig(\n                                    tables.forTable(id), tableMap.get(idWithCatalog));\n                    TableChanges.TableChange tableChange =\n                            new TableChanges.TableChange(\n                                    TableChanges.TableChangeType.CREATE, table);\n                    schemasByTableId.put(idWithCatalog, tableChange);\n                }\n            }\n        } catch (SQLException e) {\n            throw new SeaTunnelException(\n                    String.format(\"Failed to read schema for table %s \", tableId), e);\n        }\n\n        if (!schemasByTableId.containsKey(tableId)) {\n            throw new SeaTunnelException(\n                    String.format(\"Can't obtain schema for table %s \", tableId));\n        }\n\n        return schemasByTableId.get(tableId);\n    }\n}\n","sourceCodeStart":72,"sourceCodeEnd":97,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-cdc/connector-cdc-postgres/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/postgres/utils/PostgresSchema.java#L72-L97","documentation":"After querying, PostgresSchema.readTableSchema checks whether the schema map contains an entry for the requested TableId; if not, it throws SeaTunnelException 'Can't obtain schema for table <id>'. Unlike error 592 the JDBC query succeeded, but no schema was returned for that exact table identifier.","triggerScenarios":"The table does not exist (or is not visible to the current user) so the catalog query returns no rows, or the requested TableId (database.schema.table, case-sensitive) does not match the key under which the schema was stored (idWithCatalog normalization mismatch).","commonSituations":"Typo in table name or wrong schema prefix in table-names config; table lives in a different database than configured; mixed-case identifiers requiring exact quoting; dropped table referenced by a still-running job config.","solutions":["Confirm the table exists: SELECT * FROM information_schema.tables WHERE table_schema='...' AND table_name='...'","Make table-names match the exact case of the Postgres schema and table (quote if needed)","Ensure the configured database contains the table; CDC reads schema from its own connection's database","Grant the CDC user visibility of the table (USAGE on schema, SELECT on table)"],"exampleFix":"// before\ntable-names = [\"public\", \"Users\"]\n// after\ntable-names = [\"public\", \"users\"]  # actual lowercase name in Postgres","handlingStrategy":"validation","validationCode":"SELECT table_schema, table_name FROM information_schema.tables\nWHERE lower(table_name) = lower('orders') AND table_schema = 'public';","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Copy table names exactly from \\dt output, including case","Confirm the table is in the database the connector connects to","Check the CDC user can see the table in information_schema"],"tags":["postgres","schema","not-found","cdc"],"backgroundTag":"schema-not-found","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}