> ## Documentation Index
> Fetch the complete documentation index at: https://xata.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# stream

> Commands for managing logical streaming replication operations

The stream command helps you manage database streaming operations with `pgstream`, using logical replication.

<Tip>
  You can override the `pgstream` binary version used by the CLI via the `XATA_PGSTREAM_BINARY_VERSION` environment variable. See [Binary Version Overrides](/cli/index#binary-version-overrides) for details.
</Tip>

## Subcommands

### destroy

Destroy any pgstream setup, removing the replication slot and all the relevant tables/functions/triggers, along with the internal pgstream schema.

```bash theme={null}
xata stream destroy --source-url <url> [--config <file>] [--log-level <level>] [--postgres-url <url>] [--replication-slot <name>] [-h|--help]
```

<ParamField path="--source-url" type="string" required>
  The source URL of the database to clone
</ParamField>

<ParamField path="--config" type="string">
  .env or .yaml config file to use with pgstream if any
</ParamField>

<ParamField path="--log-level" type="string">
  Log level for pgstream (trace|debug|info|warn|error|fatal|panic, default: info)
</ParamField>

<ParamField path="--postgres-url" type="string">
  Source postgres URL where pgstream destroy will be run
</ParamField>

<ParamField path="--replication-slot" type="string">
  Name of the postgres replication slot to be deleted by pgstream from the source url
</ParamField>

<ParamField path="-h, --help" type="boolean">
  Print help information and exit
</ParamField>

## Global Flags

<ParamField path="-h, --help" type="boolean">
  Print help information and exit
</ParamField>

<ParamField path="--json" type="boolean">
  Output in JSON format
</ParamField>
