pathwaycom/pathway · error · ValueError
'replication_slot_name' is not needed for the static mode
Error message
'replication_slot_name' is not needed for the static mode
What it means
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.
Source
Thrown at python/pathway/io/postgres/__init__.py:260
raise ValueError(f"sslrootcert is not readable: {e}") from e
return TLSSettings(mode=sslmode, root_cert_path=sslrootcert)
def _construct_replication_settings(
*,
mode: Literal["streaming", "static"],
postgres_settings: dict,
publication_name: str | None,
replication_slot_name: str | None,
snapshot_name: str | None,
):
# static mode doesn't require replication slots
if mode == "static":
if publication_name is not None:
raise ValueError("'publication_name' is not needed for the static mode")
if replication_slot_name is not None:
raise ValueError(
"'replication_slot_name' is not needed for the static mode"
)
if snapshot_name is not None:
raise ValueError("'snapshot_name' is not needed for the static mode")
return None
if publication_name is None:
raise ValueError("'publication_name' is required for the streaming mode")
# streaming mode: user provides publication, we create the slot
replication_slot_defined = replication_slot_name is None
snapshot_name_defined = snapshot_name is None
if replication_slot_defined != snapshot_name_defined:
raise ValueError(
"Either none or both of 'replication_slot_name', 'snapshot_name' must be specified"
)
return api.PsqlReplicationSettings(
connection_string=(View on GitHub (pinned to fa2f74a464)
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".
Example fix
# before pw.io.postgres.read(parts, "tbl", mode="static", replication_slot_name="pw_slot", snapshot_name="snap") # after pw.io.postgres.read(parts, "tbl", mode="static")
Defensive patterns
Strategy: validation
Validate before calling
if mode == "static":
assert replication_slot_name is None and snapshot_name is None, "slot/snapshot are streaming-only" Prevention
- 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.
When it happens
Trigger: pw.io.postgres.read(..., mode="static", replication_slot_name="slot") or (... , mode="static", replication_slot_name=..., snapshot_name=...).
Common situations: 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.
Related errors
- 'publication_name' is not needed for the static mode
- 'snapshot_name' is not needed for the static mode
- 'publication_name' is required for the streaming mode
- Either none or both of 'replication_slot_name', 'snapshot_na
- pw.io.mssql.read requires at least one primary key column in
AI-assisted analysis of pathwaycom/pathway@fa2f74a464 (2026-08-15).
Data as JSON: /api/errors/16b579618f81a10d.
Report an issue: GitHub.