terminate_backend
Terminate a PostgreSQL backend by PID to stop blocking or stuck queries. Includes dry-run preview and audit logging to prevent accidental termination.
Instructions
[WRITE][risk=high] Terminate a backend (pg_terminate_backend). No safe inverse.
Captures the backend's pid + query for the audit trail; a terminate cannot be
undone, so no undo is offered. Pass dry_run=True to preview.
Refuses this tool's own backend pid — including under dry_run, which must
report a refusal rather than preview a call that will be refused.
Args:
pid: Backend process id (from list_activity).
dry_run: If True, preview without terminating.
target: Target name from config; omit for the default.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pid | Yes | ||
| target | No | ||
| dry_run | No |