{"record":{"id":"8c0d6a8ea485bc3e","repo":"pathwaycom/pathway","slug":"publication-name-is-not-needed-for-the-static-mo","errorCode":null,"errorMessage":"'publication_name' is not needed for the static mode","messagePattern":"'publication_name' is not needed for the static mode","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/pathway/io/postgres/__init__.py","lineNumber":258,"sourceCode":"            raise ValueError(\"sslrootcert points to a non-existent path\") from e\n        except OSError as e:\n            raise ValueError(f\"sslrootcert is not readable: {e}\") from e\n\n    return TLSSettings(mode=sslmode, root_cert_path=sslrootcert)\n\n\ndef _construct_replication_settings(\n    *,\n    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","sourceCodeStart":240,"sourceCodeEnd":276,"githubUrl":"https://github.com/pathwaycom/pathway/blob/fa2f74a4649b7c5908690cf60137263d8d80de5f/python/pathway/io/postgres/__init__.py#L240-L276","documentation":"Raised by _construct_replication_settings in the postgres connector when mode=\"static\" (a one-shot snapshot read) is combined with a non-None publication_name. Publications are a logical-replication concept used only by streaming mode; in static mode Pathway reads data directly and never consumes a publication.","triggerScenarios":"pw.io.postgres.read(..., mode=\"static\", publication_name=\"pub\") — note the arguments are accepted but rejected as contradictory.","commonSituations":"Switching a pipeline from streaming to static (e.g. for backfill or tests) and leaving the streaming publication/slot arguments in place; copy-pasting a read() call and changing only mode.","solutions":["Remove publication_name from the static-mode read call.","Also remove replication_slot_name and snapshot_name if present (they raise sibling errors).","Keep the publication arguments only in the streaming call."],"exampleFix":"# before\npw.io.postgres.read(parts, \"tbl\", mode=\"static\", publication_name=\"mypub\")\n# after\npw.io.postgres.read(parts, \"tbl\", mode=\"static\")","handlingStrategy":"validation","validationCode":"if mode == \"static\":\n    for k in (\"publication_name\", \"replication_slot_name\", \"snapshot_name\"):\n        kwargs.pop(k, None)  # strip streaming-only args","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep separate kwargs dicts for static and streaming reads instead of one shared dict.","When toggling mode in config, review all replication-related arguments together."],"tags":["postgres","cdc","replication","invalid-argument"],"backgroundTag":null,"analyzedSha":"fa2f74a4649b7c5908690cf60137263d8d80de5f","analyzedAt":"2026-08-15T01:48:17.006Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}