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