Contents
pg_wait_for_backend_termination()
A proposed function which waits for a backend to terminate
This entry relates to a feature which was incorporated into PostgreSQL 14 but subsequently withdrawn.
pg_wait_for_backend_termination()
was a system function which waits for a backend to terminate.
pg_wait_for_backend_termination()
was added in PostgreSQL 14 but subsequently withdrawn.
Usage
pg_wait_for_backend_termination ( pid INTEGER, timeout BIGINT DEFAULT 5000 ) → BOOLEAN
When pg_terminate_backend()
is used to attempt termination of a backend, there may be some delay until the backend can be terminated. pg_wait_for_backend_termination()
provides a method for clients to determine when the termination takes place.
Note that a timeout value must be supplied; it is not possible to specify an indefinite timeout.
Change history
Examples
postgres=# SELECT pg_wait_for_backend_termination(1268106); WARNING: backend with PID 1268106 did not terminate within 5000 milliseconds pg_wait_for_backend_termination --------------------------------- f (1 row) Time: 5007.215 ms (00:05.007)
Attempting to determine the status of a PID which does not belong to the running PostgreSQL instance:
postgres=# SELECT pg_wait_for_backend_termination(123456); WARNING: PID 123456 is not a PostgreSQL server process pg_wait_for_backend_termination --------------------------------- f (1 row)
References
- PostgreSQL 14 documentation: Server Signaling Functions