SQLSTATE 55006 ERROR Class 55: Object Not In Prerequisite State

object_in_use replication slot “…” is active for PID N — 55006

PostgreSQL error “replication slot … is active for PID N — 55006” (SQLSTATE 55006): 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 operation (e.g. dropping a slot) failed because the replication slot is currently in use by another process. PostgreSQL raises SQLSTATE 55006 (object_in_use).

  • The slot is actively held by a connected consumer.
  • Common when trying to drop a slot still in use.
  • The holding PID is shown.

What the server log shows

ERROR:  replication slot "standby_1" is active for PID 4242

Why PostgreSQL raises this — what the manual says

As Section 26.2.6 Replication Slots explains:

The operation (such as dropping the slot) failed because a walsender is currently connected to it; a slot in active use cannot be modified or dropped until the consuming standby or client disconnects.

A slot is exclusive to one active consumer connection. Attempting to drop or otherwise exclusively use a slot another process holds conflicts with that ownership, so PostgreSQL reports 55006.

Common causes

  • Dropping a slot while a consumer is still connected.
  • A standby/logical consumer holding the slot.
  • A stuck or zombie connection retaining the slot.

How to fix it

  1. Stop the consumer holding the slot, then retry.
  2. Identify and terminate the holding backend if necessary: SELECT pg_terminate_backend(4242); (with caution).
  3. Wait for the active consumer to disconnect before dropping.

Related & next steps

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

Was this helpful?