Re: [GENERAL] How to check for pending CancelRequest from C/C++ function

2014-01-06 Thread Tom Lane
Stephen Woodbridge writes: > On 1/6/2014 10:32 AM, Tom Lane wrote: >> Put "CHECK_FOR_INTERRUPTS();" in some suitably safe place. > So if I need to clean up then I should check do something like: > if (InterruptPending) { > /* cleanup here */ > ProcessInterrupts(); > } Uh, no, you shou

Re: [GENERAL] How to check for pending CancelRequest from C/C++ function

2014-01-06 Thread Stephen Woodbridge
On 1/6/2014 10:32 AM, Tom Lane wrote: Stephen Woodbridge writes: I writing some functions for postgresql extension in C/C++ and I would like to be able to check for a pending CancelRequest from the frontend so I can take appropriate action to honor this request. Put "CHECK_FOR_INTERRUPTS();"

[GENERAL] How to check for pending CancelRequest from C/C++ function

2014-01-06 Thread Stephen Woodbridge
Hi all, I writing some functions for postgresql extension in C/C++ and I would like to be able to check for a pending CancelRequest from the frontend so I can take appropriate action to honor this request. 1. How to I check if a request is pending? 2. What is the appropriate action? I assu

Re: [GENERAL] How to check for pending CancelRequest from C/C++ function

2014-01-06 Thread Tom Lane
Stephen Woodbridge writes: > I writing some functions for postgresql extension in C/C++ and I would > like to be able to check for a pending CancelRequest from the frontend > so I can take appropriate action to honor this request. Put "CHECK_FOR_INTERRUPTS();" in some suitably safe place.