Requests that the server abandon processing of the current command.
The return value is
1if the cancel request was successfully dispatched and0if not. If not,errbufis filled with an explanatory error message.errbufmust be a char array of sizeerrbufsize(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.
PQcancelcan safely be invoked from a signal handler, if theerrbufis a local variable in the signal handler. ThePGcancelobject is read-only as far asPQcancelis concerned, so it can also be invoked from a thread that is separate from the one manipulating thePGconnobject.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(c_ptr), | intent(in) | :: | cancel | |||
| character(len=*), | intent(inout) | :: | errbuf | |||
| integer(kind=int32), | intent(in) | :: | errbufsize |