---
title: "DROP_REPLICATION_SLOT"
url: "https://docs.yugabyte.com/stable/api/ysql/the-sql-language/statements/streaming_drop_repl_slot/"
---

# DROP_REPLICATION_SLOT

Use the DROP_REPLICATION_SLOT statement to drop an existing replication slot.

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

- [![Grammar Icon](/icons/file-lines.svg)Grammar](#grammar-1)
- [![Diagram Icon](/icons/diagram.svg)Diagram](#diagram-1)

```output.ebnf
drop_replication_slot ::= DROP_REPLICATION_SLOT slot_name
```

#### drop\_replication\_slot

DROP\_REPLICATION\_SLOT[slot\_name](/stable/api/ysql/syntax_resources/grammar_diagrams#slot-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`.

```sql
bin/ysqlsh "dbname=yugabyte replication=database"
```

Drop a replication slot.

```sql
yugabyte=# DROP_REPLICATION_SLOT test_replication_slot;
```

## See also

- [CREATE\_REPLICATION\_SLOT](/stable/api/ysql/the-sql-language/statements/streaming_create_repl_slot "CREATE_REPLICATION_SLOT")
- [START\_REPLICATION](/stable/api/ysql/the-sql-language/statements/streaming_start_replication "START_REPLICATION")
