Changes and migrations · stop 10 of 10

terminate_query

Cancels or ends a running query by its pid.

Needs admin modeTool sets: dba · full

You might ask

“Cancel the query that's blocking checkout.”

Your assistant may call terminate_query to answer.

How it works

  • Needs admin mode. Cancels the query by default; force: true ends the whole session.
  • Refuses to touch superuser sessions or its own.

Parameters

pidnumberrequired
Backend process id to cancel/terminate.
forceboolean
If true, force-terminate the backend (pg_terminate_backend) instead of a soft cancel. Default false.

What your assistant reads

The description nexql-mcp sends with the tool. It's how the assistant decides when to use it.

Cancel (pg_cancel_backend) or force-terminate (pg_terminate_backend) a backend by pid. Admin mode only. Refuses superuser targets and the current session.