{"record":{"id":"16b579618f81a10d","repo":"pathwaycom/pathway","slug":"replication-slot-name-is-not-needed-for-the-stat","errorCode":null,"errorMessage":"'replication_slot_name' is not needed for the static mode","messagePattern":"'replication_slot_name' is not needed for the static mode","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/pathway/io/postgres/__init__.py","lineNumber":260,"sourceCode":"            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\n    return api.PsqlReplicationSettings(\n        connection_string=(","sourceCodeStart":242,"sourceCodeEnd":278,"githubUrl":"https://github.com/pathwaycom/pathway/blob/fa2f74a4649b7c5908690cf60137263d8d80de5f/python/pathway/io/postgres/__init__.py#L242-L278","documentation":"Raised by _construct_replication_settings when mode=\"static\" is combined with a non-None replication_slot_name. Static reads create no replication slot; naming one is contradictory and would silently mislead the user, so Pathway rejects it at call time.","triggerScenarios":"pw.io.postgres.read(..., mode=\"static\", replication_slot_name=\"slot\") or (... , mode=\"static\", replication_slot_name=..., snapshot_name=...).","commonSituations":"Downgrading a CDC pipeline to a one-shot snapshot read for testing while keeping slot parameters; reusing a shared kwargs dict between streaming and static calls.","solutions":["Delete replication_slot_name (and snapshot_name) from the static-mode call.","If you build kwargs dynamically, gate them: only add slot/snapshot keys when mode == \"streaming\"."],"exampleFix":"# before\npw.io.postgres.read(parts, \"tbl\", mode=\"static\", replication_slot_name=\"pw_slot\", snapshot_name=\"snap\")\n# after\npw.io.postgres.read(parts, \"tbl\", mode=\"static\")","handlingStrategy":"validation","validationCode":"if mode == \"static\":\n    assert replication_slot_name is None and snapshot_name is None, \"slot/snapshot are streaming-only\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat replication_slot_name and snapshot_name as a streaming-mode-only pair.","Build read() kwargs from a small helper that filters arguments by mode."],"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"}