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

# sabaoth postgres delete

> Permanently delete a PostgreSQL service

Permanently deletes a service. To confirm, you type the service's ID back, not just `y`.

```bash theme={null}
sabaoth postgres delete <service-id> [--yes] [--org <org-id>] [--json]
```

> [!WARNING]
>
> Deletion can't be undone, and any backup not already taken is lost. Take a backup first if you might need the data: see [`sabaoth backup create`](https://docs.sabaothcloud.com/cli/commands/backup-create).

## Arguments

**service-id** `string` *required*

The ID of the service to delete, for example `clu_abc`.

## Flags

**--yes** `boolean` (default: false)

Skip the confirmation prompt. Required when there's no terminal. The organization check described below still happens.

**--org** `string`

Organization the service belongs to, instead of the selected one.

**--json** `boolean` (default: false)

Print the result as JSON on stdout.

## Examples

```bash theme={null}
sabaoth postgres delete clu_abc
sabaoth postgres delete clu_abc --yes
```

## Confirmation

The CLI first looks up the service, then shows its name and ID and asks you to type the ID:

```text theme={null}
Permanently delete a PostgreSQL cluster from Acme (org_abc):
  Name:     orders-db
  Cluster:  clu_abc

This cannot be undone. Any backup not already taken is lost.
Type clu_abc to confirm, or press Enter to cancel:
```

Anything other than the exact ID, including just pressing Enter, cancels with `DECLINED` (exit `2`) and nothing is deleted.

Typing the ID confirms you have the **right** service, not just that you meant to press a key. With an irreversible action, the bigger risk is looking at the wrong resource.

There is no dry-run mode and no waiting period. Typing the ID is the safeguard.

## Output

```text theme={null}
Deletion of orders-db (clu_abc) accepted.
Removal continues in the background; confirm with `sabaoth postgres get clu_abc`.
```

With `--json`:

```json theme={null}
{ "id": "clu_abc", "name": "orders-db", "accepted": true }
```

Deletion happens in the background. The service may still show up for a short while, with a `deleting` status. `accepted: true` means the API took the request, not that the service is already gone.

## Behavior

* **The service is always read first**, even with `--yes`. This gets the name for the prompt, and makes sure the service is in the effective organization. An API key can sometimes reach services in several organizations, and `--yes` must never become a way to delete outside the one you're working in.
* A service in another organization is reported as `CLUSTER_NOT_FOUND`, the same as one that doesn't exist, and nothing is deleted.
* If the API returns the service without an organization, the CLI refuses with `ORGANIZATION_SCOPE_UNVERIFIABLE` rather than guessing.

## If the result is unknown

If the delete request was sent but no response came back, the service may or may not have been deleted. The CLI **never retries**. It fails with `UNKNOWN_MUTATION_OUTCOME` and asks you to run `sabaoth postgres get <service-id>` to check.

## Errors

| Code | Exit | Meaning |
| - | - | - |
| `DECLINED` | 2 | The typed ID didn't match. Nothing was deleted. |
| `CONFIRMATION_REQUIRED` | 2 | No terminal to ask for confirmation. Re-run with `--yes`. |
| `CLUSTER_NOT_FOUND` | 1 | No service with this ID in the effective organization. Nothing was deleted. |
| `ORGANIZATION_SCOPE_UNVERIFIABLE` | 1 | The CLI couldn't confirm which organization the service belongs to. Nothing was deleted. |
| `DELETION_NOT_PERMITTED` | 1 | The server refused, for example because your role can't delete services. |
| `INVALID_CLUSTER_ID` | 1 | The API rejected the value as a service ID. |
| `UNKNOWN_MUTATION_OUTCOME` | 1 | No response. See [above](#if-the-result-is-unknown). |

## Related

* [`sabaoth backup create`](https://docs.sabaothcloud.com/cli/commands/backup-create)
* [Managing services in the dashboard](https://docs.sabaothcloud.com/dashboard/managing-services.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.