PQcancel
Function
PQcancel is used to request the server to abandon processing of the current command.
Prototype
int PQcancel(PGcancel* cancel, char* errbuf, int errbufsize);
Parameter
Keyword |
Parameter Description |
---|---|
cancel |
Points to the object pointer that contains the cancel information. |
errbuf |
Buffer for storing error information. |
errbufsize |
Size of the buffer for storing error information. |
Return Value
int indicates the execution result. 1 indicates successful execution and 0 indicates an execution failure. The failure cause is stored in errbuf.
Precautions
- Successful sending does not guarantee that the request will have any effect. If the cancellation is valid, the current command is terminated early and an error is returned. If the cancellation fails (for example, because the server has processed the command), no result is returned.
- If errbuf is a local variable in a signal handler, you can safely call PQcancel from the signal handler. For PQcancel, the PGcancel object is read-only, so it can also be called from a thread that is separate from the thread that is operating the PGconn object.
Example
For details, see Examples.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot