{"record":{"id":"087c384f73cd64c0","repo":"apache/seatunnel","slug":"unable-to-s-filtered-publication-s-for-s","errorCode":null,"errorMessage":"Unable to %s filtered publication %s for %s","messagePattern":"Unable to (.+?) filtered publication (.+?) for (.+?)","errorType":"exception","errorClass":"ConnectException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-cdc/connector-cdc-opengauss/src/main/java/io/debezium/connector/postgresql/connection/PostgresReplicationConnection.java","lineNumber":278,"sourceCode":"                                \"No table filters found for filtered publication %s\",\n                                publicationName));\n            }\n            createOrUpdatePublicationStmt =\n                    isUpdate\n                            ? String.format(\n                                    \"ALTER PUBLICATION %s SET TABLE %s;\",\n                                    publicationName, tableFilterString)\n                            : String.format(\n                                    \"CREATE PUBLICATION %s FOR TABLE %s;\",\n                                    publicationName, tableFilterString);\n            LOGGER.info(\n                    isUpdate\n                            ? \"Updating Publication with statement '{}'\"\n                            : \"Creating Publication with statement '{}'\",\n                    createOrUpdatePublicationStmt);\n            conn.execute(createOrUpdatePublicationStmt);\n        } catch (Exception e) {\n            throw new ConnectException(\n                    String.format(\n                            \"Unable to %s filtered publication %s for %s\",\n                            isUpdate ? \"update\" : \"create\", publicationName, tableFilterString),\n                    e);\n        }\n    }\n\n    private Set<TableId> determineCapturedTables() throws Exception {\n        Set<TableId> allTableIds = jdbcConnection.getAllTableIds(connectorConfig.databaseName());\n\n        Set<TableId> capturedTables = new HashSet<>();\n\n        for (TableId tableId : allTableIds) {\n            if (tableFilter.dataCollectionFilter().isIncluded(tableId)) {\n                LOGGER.trace(\"Adding table {} to the list of captured tables\", tableId);\n                capturedTables.add(tableId);\n            } else {\n                LOGGER.trace(","sourceCodeStart":260,"sourceCodeEnd":296,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-cdc/connector-cdc-opengauss/src/main/java/io/debezium/connector/postgresql/connection/PostgresReplicationConnection.java#L260-L296","documentation":"Thrown by PostgresReplicationConnection when the CREATE or ALTER PUBLICATION SQL statement fails during filtered publication setup. The library wraps the underlying SQLException from conn.execute() in a ConnectException, indicating whether it was attempting to create a new publication or update an existing one. The publication name and table filter string are included so the operator can inspect the offending publication in the database.","triggerScenarios":"Executing CREATE PUBLICATION <name> FOR TABLE <filter> or ALTER PUBLICATION <name> SET TABLE <filter> (via initPublication -> createOrUpdatePublicationModeFilterted) fails: e.g. insufficient privileges, the publication does not exist when updating, or an invalid table filter expression.","commonSituations":"The DB user lacks CREATE or ownership rights on the database/publication; publication.autocreate.mode is 'filtered' but the configured table list has syntax errors; the publication was dropped manually while the connector expects to update it; running against openGauss/Postgres versions where ALTER PUBLICATION ... SET TABLE is unsupported; max publication limits reached (e.g. max_replication_slots or publication-per-database limits on managed services).","solutions":["Grant the connector user the required privileges (CREATE on the database, or make it owner of the publication, or a superuser/rds_replication role).","Verify the table filter string in your config (table.include.list / schema include patterns) resolves to valid table names and the publication does not already exist with a conflicting definition.","If the publication exists but is not owned by the connector user, either drop it (DROP PUBLICATION) so it can be recreated, or ALTER PUBLICATION <name> OWNER TO <connector_user>.","Check the server logs / the wrapped cause (e) for the exact PostgreSQL error code and message; fix the SQL-level problem it reports.","Set publication.autocreate.mode to 'disabled' and pre-create the publication manually if you cannot grant privileges."],"exampleFix":"// before: connector fails creating filtered publication with limited user\nGRANT CREATE ON DATABASE mydb TO cdc_user;\n// or pre-create and transfer ownership:\nCREATE PUBLICATION dbz_publication FOR TABLE public.orders;\nALTER PUBLICATION dbz_publication OWNER TO cdc_user;","handlingStrategy":"try-catch","validationCode":"-- run before starting the connector\nSELECT current_user, has_database_privilege(current_user, 'mydb', 'CREATE');\nSELECT pubname, puballtables FROM pg_publication WHERE pubname = 'dbz_publication';\nSELECT * FROM pg_roles WHERE rolname = 'cdc_user';","typeGuard":null,"tryCatchPattern":"try {\n    connector.start();\n} catch (ConnectException e) {\n    if (e.getMessage().startsWith(\"Unable to create filtered publication\")) {\n        // grant privileges or pre-create publication manually, then retry\n    } else {\n        throw e;\n    }\n}","preventionTips":["Grant CREATE on the database and make the connector user owner of the publication before first start.","Keep publication.autocreate.mode='disabled' with manually pre-created publications in production.","Validate table.include.list patterns resolve to real tables before deployment.","Pin one publication name per connector to avoid ownership conflicts."],"tags":["postgresql","cdc","replication","publication","sql"],"backgroundTag":"sql-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"}