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

undefined_object replication slot “…” does not exist — 42704

PostgreSQL error “replication slot … does not exist — 42704” (SQLSTATE 42704): 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

A command referenced a replication slot that does not exist. PostgreSQL raises SQLSTATE 42704 (undefined_object).

  • The named replication slot is not present.
  • Common after the slot was dropped or never created.
  • Affects physical/logical replication consumers.

What the server log shows

ERROR:  replication slot "standby_1" does not exist

Why PostgreSQL raises this — what the manual says

As Section 26.2.6 Replication Slots explains:

The command referenced a replication slot name that is not present in the pg_replication_slots view; the slot must be created (for example with pg_create_physical_replication_slot) before a standby can use it via primary_slot_name.

Replication slots are named server objects tracked in pg_replication_slots. Referencing a name that isn’t present (dropped, never created, or wrong node) can’t be resolved, so PostgreSQL reports 42704.

Common causes

  • The slot was dropped or never created.
  • A typo in the slot name.
  • Connecting to the wrong server/node.

How to fix it

  1. List slots: SELECT slot_name FROM pg_replication_slots; and use a valid name.
  2. Create the slot before the consumer connects (physical or logical).
  3. Verify you are connected to the correct primary.

Related & next steps

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

Was this helpful?