PQcancel Function

public function PQcancel(cancel, errbuf, errbufsize)

Requests that the server abandon processing of the current command.

The return value is 1 if the cancel request was successfully dispatched and 0 if not. If not, errbuf is filled with an explanatory error message. errbuf must be a char array of size errbufsize (the recommended size is 256 bites).

Successful dispatch is no guarantee that the request will have any effect, however. If the cancellation is effective, the current command will terminate early and return an error result. If the cancellation fails (say, because the server was already done processing the command), then there will be no visible result at all.

PQcancel can safely be invoked from a signal handler, if the errbuf is a local variable in the signal handler. The PGcancel object is read-only as far as PQcancel is concerned, so it can also be invoked from a thread that is separate from the one manipulating the PGconn object.

cf. PostgreSQL Documentation

Arguments

Type IntentOptional Attributes Name
type(c_ptr), intent(in) :: cancel
character(len=*), intent(inout) :: errbuf
integer(kind=int32), intent(in) :: errbufsize

Return Value integer(kind=int32)


Contents