Re: [HACKERS] Optional message to user when terminating/cancelling backend - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: [HACKERS] Optional message to user when terminating/cancelling backend
Date
Msg-id CAB7nPqRS9zY4QNhtq7=Xo_boYVKBqx57db=sKgUrEh79z-6UVA@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] Optional message to user when terminating/cancelling backend  (Daniel Gustafsson <daniel@yesql.se>)
Responses Re: [HACKERS] Optional message to user when terminating/cancellingbackend  (Yugo Nagata <nagata@sraoss.co.jp>)
List pgsql-hackers
On Wed, Jun 21, 2017 at 11:42 PM, Daniel Gustafsson <daniel@yesql.se> wrote:
> The message is truncated in SetBackendCancelMessage() for safety, but
> pg_{cancel|terminate}_backend() could throw an error on too long message, or
> warning truncation, to the caller as well.  Personally I think a warning is the
> appropriate response, but I don’t really have a strong opinion.

And a NOTICE? That's what happens for relation name truncation. You
are right that having a check in SetBackendCancelMessage() makes the
most sense as bgworkers could just call the low level API. Isn't the
concept actually closer to just a backend message? This slot could be
used for other purposes than cancellation.
--
Michael



pgsql-hackers by date:

Previous
From: Rod Taylor
Date:
Subject: Re: [HACKERS] RLS in CTE incorrect permission failure
Next
From: Andres Freund
Date:
Subject: Re: [HACKERS] PATCH: Batch/pipelining support for libpq