Requires replication connection.
This command can only be executed on a walsender backend which can be started by establishing a replication connection. A replication connection can be created by passing the parameter replication=database in the connection string. Refer to examples section.

Synopsis

Use the DROP_REPLICATION_SLOT statement to drop a replication slot.

Syntax

drop_replication_slot ::= DROP_REPLICATION_SLOT slot_name

drop_replication_slot

DROP_REPLICATION_SLOTslot_name

Semantics

slot_name

The name of the replication slot.

Note

A replication slot can only be dropped after the client consuming from it has been stopped for at least ysql_cdc_active_replication_slot_window_ms duration. The default value of the flag is 5 minutes.

Examples

Establish a replication connection to the database yugabyte.

bin/ysqlsh "dbname=yugabyte replication=database"

Drop a replication slot.

yugabyte=# DROP_REPLICATION_SLOT test_replication_slot;

See also