{"record":{"id":"51da04a74aedbb4f","repo":"pathwaycom/pathway","slug":"snapshot-name-is-not-needed-for-the-static-mode","errorCode":null,"errorMessage":"'snapshot_name' is not needed for the static mode","messagePattern":"'snapshot_name' is not needed for the static mode","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/pathway/io/postgres/__init__.py","lineNumber":264,"sourceCode":"\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=(\n            _replication_connection_string_from_settings(postgres_settings)\n        ),\n        publication_name=publication_name,\n        snapshot_name=snapshot_name,","sourceCodeStart":246,"sourceCodeEnd":282,"githubUrl":"https://github.com/pathwaycom/pathway/blob/fa2f74a4649b7c5908690cf60137263d8d80de5f/python/pathway/io/postgres/__init__.py#L246-L282","documentation":"Raised by _construct_replication_settings when mode=\"static\" is combined with a non-None snapshot_name. Snapshots for replication resume are meaningful only in streaming mode; a static read already takes its own consistent snapshot, so the argument is rejected.","triggerScenarios":"pw.io.postgres.read(..., mode=\"static\", snapshot_name=\"mysnap\").","commonSituations":"Porting an existing streaming read with an exported snapshot to a static backfill job; IDE autocompleting all replication kwargs.","solutions":["Remove snapshot_name from the static-mode call.","Remove publication_name/replication_slot_name too if present (sibling checks)."],"exampleFix":"# before\npw.io.postgres.read(parts, \"tbl\", mode=\"static\", snapshot_name=\"snap1\")\n# after\npw.io.postgres.read(parts, \"tbl\", mode=\"static\")","handlingStrategy":"validation","validationCode":"if mode == \"static\":\n    assert snapshot_name is None, \"snapshot_name is streaming-only\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Remember static mode takes its own consistent snapshot; resume parameters do not apply.","Audit replication kwargs whenever changing 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"}