SQLSTATE 42710 ERROR Class 42: Syntax Error or Access Rule Violation

duplicate_object replication slot “…” already exists — 42710

PostgreSQL error “replication slot … already exists — 42710” (SQLSTATE 42710): what it means, common causes, and how to fix it.

PG 9.4, 10, 11, 12, 13, 14, 15, 16, 17, 18 Official docs
Last reviewed Jun 2026 Grounded in source

Diagnostic Queries

Symptoms

An attempt to create a replication slot used a name that already exists. PostgreSQL raises SQLSTATE 42710 (duplicate_object).

  • A slot with that name already exists.
  • Common when a consumer reconnects and recreates a slot.
  • Slot names are unique per cluster.

What the server log shows

ERROR:  replication slot "standby_1" already exists

Why PostgreSQL raises this — what the manual says

As Section 26.2.6 Replication Slots explains:

An attempt to create a replication slot reused a name that already exists; each slot name must be unique, so drop the existing slot or choose a different name before creating it.

Replication slot names are unique per cluster. Creating one whose name is already taken collides with the existing slot, so PostgreSQL reports 42710.

Common causes

  • Recreating a slot that already exists.
  • Two consumers configured with the same slot name.
  • A leftover slot from a previous setup.

How to fix it

  1. Reuse the existing slot instead of recreating it.
  2. Drop the old slot first if it’s stale: SELECT pg_drop_replication_slot('standby_1'); (ensure no consumer needs it).
  3. Use distinct slot names per consumer.

Related & next steps

Reference: PostgreSQL 18 Section 27.2 “Log-Shipping Standby Servers”.

Was this helpful?