> On 27 Mar 2018, at 13:50, Eren Başak <e...@citusdata.com> wrote:

> > pg_cancel_backend() is defined proisstrict, while pg_cancel_backend_msg() is
> > not.  I think we must be able to perform the cancellation if the message is
> > NULL, so made it two functions.
> I agree that we should preserve the old usage as well. What I don't 
> understand is that, can't we remove proisstrict from pg_cancel_backend and 
> copy the body of pg_cancel_backend_msg into pg_cancel_backend. This way, I 
> think we can accomplish the same thing without introducing two new functions.

If we do that, wouldn’t SELECT pg_cancel_backend(NULL) fail unless NULL is
explicitly casted to integer?  Also, I think that would cause make check to
fail the opr_sanity suite on the “multiple uses of the same internal function”
test.  Maybe I’m misunderstanding your point here?

> pg_terminate_backend_msg errors out if the pid is null but 
> pg_cancel_backend_msg returns null and I think we should have consistency 
> between these two in this regard.

Absolutely, that was an oversight in the v8 patch, they should both handle NULL
in the same way.

Whitespace and null handling fixed, as well as rebased over HEAD.

cheers ./daniel

Attachment: 0001-Refactor-backend-signalling-code-v9.patch
Description: Binary data

Attachment: 0002-Support-optional-message-in-backend-cancel-terminate-v9.patch
Description: Binary data

Reply via email to