{"record":{"id":"5ac7c0e7830b5aed","repo":"apache/seatunnel","slug":"error-to-discover-tables-e-getmessage-5ac7c0","errorCode":null,"errorMessage":"Error to discover tables: ${e.getMessage()}","messagePattern":"Error to discover tables: (.+?)","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/source/PostgresDialect.java","lineNumber":122,"sourceCode":"                \"postgres-dialect\");\n    }\n\n    @Override\n    public ChunkSplitter createChunkSplitter(JdbcSourceConfig sourceConfig) {\n        return new PostgresChunkSplitter(sourceConfig, this);\n    }\n\n    @Override\n    public List<TableId> discoverDataCollections(JdbcSourceConfig sourceConfig) {\n        PostgresSourceConfig postgresSourceConfig = (PostgresSourceConfig) sourceConfig;\n        try (JdbcConnection jdbcConnection = openJdbcConnection(sourceConfig)) {\n            List<TableId> tables =\n                    TableDiscoveryUtils.listTables(\n                            jdbcConnection, postgresSourceConfig.getTableFilters());\n            this.checkAllTablesEnabledCapture(jdbcConnection, tables);\n            return tables;\n        } catch (SQLException e) {\n            throw new SeaTunnelException(\"Error to discover tables: \" + e.getMessage(), e);\n        }\n    }\n\n    @Override\n    public void checkAllTablesEnabledCapture(JdbcConnection jdbcConnection, List<TableId> tableIds)\n            throws SQLException {\n        PostgresConnection postgresConnection = (PostgresConnection) jdbcConnection;\n        for (TableId tableId : tableIds) {\n            ServerInfo.ReplicaIdentity replicaIdentity =\n                    postgresConnection.readReplicaIdentityInfo(tableId);\n            if (requireReplicaIdentityFull\n                    && !ServerInfo.ReplicaIdentity.FULL.equals(replicaIdentity)) {\n                throw new SeaTunnelException(\n                        String.format(\n                                \"Table %s does not have a full replica identity, please execute: ALTER TABLE %s REPLICA IDENTITY FULL;\",\n                                tableId, tableId));\n            }\n        }","sourceCodeStart":104,"sourceCodeEnd":140,"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/source/PostgresDialect.java#L104-L140","documentation":"PostgresDialect.discoverDataCollections lists tables matching the configured table filters via JDBC and validates capture settings. Any SQLException is wrapped in SeaTunnelException('Error to discover tables: ...'). It signals the table-discovery SQL against the source database failed.","triggerScenarios":"Thrown from discoverDataCollections during source setup when TableDiscoveryUtils.listTables or readReplicaIdentityInfo JDBC calls throw SQLException (called by discoverTables).","commonSituations":"Database unreachable at startup; user lacks SELECT on the schema/catalog; invalid database name; connection timeout; SSL configuration mismatch.","solutions":["Read the wrapped e.getMessage() in the exception for the underlying SQL error.","Verify connectivity and credentials (psql test with the same user/host).","Grant the user SELECT permission on the target schema and pg catalog tables.","Check the table pattern/filters resolve to existing tables in the configured database."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"psql \"postgres://user@host:5432/mydb\" -c \"SELECT table_schema, table_name FROM information_schema.tables WHERE table_schema='public';\"","typeGuard":null,"tryCatchPattern":"try {\n  startCdcSource(cfg);\n} catch (SeaTunnelException e) {\n  if (e.getMessage().startsWith(\"Error to discover tables\")) {\n    // check e.getCause() SQLException: connectivity/permission; retry\n  }\n}","preventionTips":["Verify credentials and network before job submission.","Confirm table-filters match existing tables in the configured database.","Grant SELECT on the target schema and catalog tables."],"tags":["postgres","cdc","database","table-discovery"],"backgroundTag":"database-query-failed","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}