↑↓ select ↵ open ⌫ change scope Open full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

Functions / System Administration Functions

pg_cancel_backend

Read the PG 18 manual

Cancels the current query of the session whose backend process has the specified process ID.

Reading PG 18current·documented in 23 of 27 versions, 8.0 to 20

Signatures & examples

pg_cancel_backend ( pid integer ) → boolean
Cancels the current query of the session whose backend process has the specified process ID. This is also allowed if the calling role is a member of the role whose backend is being canceled or the calling role has privileges of pg_signal_backend, however only superusers can cancel superuser backends. As an exception, roles with privileges of pg_signal_autovacuum_worker are permitted to cancel autovacuum worker processes, which are otherwise considered superuser backends.
Version history 8
  1. 17 → 18 changed
  2. 14 → 15 changed
  3. 12 → 13 changed
  4. 9.5 → 9.6 changed
  5. 9.4 → 9.5 changed
  6. 9.1 → 9.2 changed
  7. 8.0 → 8.1 changed
  8. 7.4 → 8.0 added

Definition snapshot: b7bd9cda · English manual source