Skip to content

ReadReplicationSlot returns the slot name as passed, not the one the server read #6735

Open

Description

@Brar

PhysicalReplicationConnection.ReadReplicationSlot (PhysicalReplicationConnection.cs:90) returns a PhysicalReplicationSlot whose Name is its argument lowercased (ReplicationConnection.cs:397-398), because the result of READ_REPLICATION_SLOT has no name, only slot_type, restart_lsn and restart_tli (walsender.c:492-497). The server reads the name as an identifier, though, so the returned name can differ from the slot it read:

  • ReadReplicationSlot(" myslot ") reads the slot myslot, since the server skips the whitespace, but returns the name " myslot ".
  • ReadReplicationSlot("\"1abc\"") reads the slot 1abc but returns the name "\"1abc\"", quotes included.

Passing the returned object back to Npgsql reaches the same slot again, but its Name isn't the slot's name. The Create*ReplicationSlot methods take the name from the server's result (ReplicationConnection.cs:353). ReadReplicationSlot should return the slot's name as the server read it too: without surrounding whitespace, and without the quotes of a quoted name.

Activity

  1. added this to the 11.0.0 milestone on Nov 1, 2026
  2. self-assigned this
    on Nov 1, 2026
  3. modified the milestones: 11.0.0, 12.0.0 on Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions