kill_query
Cancel or terminate a PostgreSQL backend session by PID. Use soft cancel to interrupt a query or hard terminate to kill the entire backend.
Instructions
Cancel or terminate a backend session by PID. mode='cancel' (soft, pg_cancel_backend) interrupts the current statement; mode='terminate' (hard, pg_terminate_backend) kills the entire backend. Both require confirm:true. Refused if the target server's effective access mode is readonly. Returns a snapshot of the target session before signaling.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pid | Yes | Backend PID to signal. | |
| mode | Yes | Soft cancel (statement only) or hard terminate (backend). | |
| confirm | Yes | Required confirmation. Foot-gun guard. | |
| server | No | ||
| database | No | ||
| schema | No |