{"record":{"id":"f8bf2a4bfafbe4db","repo":"pathwaycom/pathway","slug":"publication-name-is-required-for-the-streaming-m","errorCode":null,"errorMessage":"'publication_name' is required for the streaming mode","messagePattern":"'publication_name' is required for the streaming mode","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/pathway/io/postgres/__init__.py","lineNumber":267,"sourceCode":"    mode: Literal[\"streaming\", \"static\"],\n    postgres_settings: dict,\n    publication_name: str | None,\n    replication_slot_name: str | None,\n    snapshot_name: str | None,\n):\n    # static mode doesn't require replication slots\n    if mode == \"static\":\n        if publication_name is not None:\n            raise ValueError(\"'publication_name' is not needed for the static mode\")\n        if replication_slot_name is not None:\n            raise ValueError(\n                \"'replication_slot_name' is not needed for the static mode\"\n            )\n        if snapshot_name is not None:\n            raise ValueError(\"'snapshot_name' is not needed for the static mode\")\n        return None\n    if publication_name is None:\n        raise ValueError(\"'publication_name' is required for the streaming mode\")\n\n    # streaming mode: user provides publication, we create the slot\n    replication_slot_defined = replication_slot_name is None\n    snapshot_name_defined = snapshot_name is None\n    if replication_slot_defined != snapshot_name_defined:\n        raise ValueError(\n            \"Either none or both of 'replication_slot_name', 'snapshot_name' must be specified\"\n        )\n\n    return api.PsqlReplicationSettings(\n        connection_string=(\n            _replication_connection_string_from_settings(postgres_settings)\n        ),\n        publication_name=publication_name,\n        snapshot_name=snapshot_name,\n        replication_slot_name=replication_slot_name,\n    )\n","sourceCodeStart":249,"sourceCodeEnd":285,"githubUrl":"https://github.com/pathwaycom/pathway/blob/fa2f74a4649b7c5908690cf60137263d8d80de5f/python/pathway/io/postgres/__init__.py#L249-L285","documentation":"Raised by _construct_replication_settings when mode=\"streaming\" but publication_name is None. Streaming mode consumes a PostgreSQL logical-replication publication, and Pathway deliberately requires the user to have created it (with a table list and REPLICA IDENTITY), so it cannot default one.","triggerScenarios":"pw.io.postgres.read(..., mode=\"streaming\") with no publication_name; passing publication_name=None explicitly.","commonSituations":"First-time CDC users who assume Pathway creates all replication objects; migrations from other CDC tools that auto-create publications.","solutions":["Create a publication on the source DB: CREATE PUBLICATION mypub FOR TABLE mytable; and set table REPLICA IDENTITY appropriately.","Pass publication_name=\"mypub\" to the streaming read.","If you did not want CDC, switch to mode=\"static\"."],"exampleFix":"-- SQL\nCREATE PUBLICATION pw_pub FOR TABLE orders;\n# python, before\npw.io.postgres.read(parts, \"orders\", mode=\"streaming\")\n# after\npw.io.postgres.read(parts, \"orders\", mode=\"streaming\", publication_name=\"pw_pub\")","handlingStrategy":"validation","validationCode":"if mode == \"streaming\":\n    assert publication_name, \"create a publication first: CREATE PUBLICATION ... FOR TABLE ...\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Provision the publication (and REPLICA IDENTITY) in your DB migration/terraform before deploying the pipeline.","Document in the repo which publication each pipeline consumes."],"tags":["postgres","cdc","replication","missing-argument"],"backgroundTag":null,"analyzedSha":"fa2f74a4649b7c5908690cf60137263d8d80de5f","analyzedAt":"2026-08-15T01:48:17.006Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}