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
- List slots:
SELECT slot_name FROM pg_replication_slots;and use a valid name. - Create the slot before the consumer connects (physical or logical).
- Verify you are connected to the correct primary.
Related & next steps
Reference: PostgreSQL 18 Section 27.2 “Log-Shipping Standby Servers”.
Thanks — noted. This helps keep the database accurate.