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

From Michael Paquier
Subject Re: [HACKERS] Optional message to user when terminating/cancellingbackend
Date
Msg-id 20180706014705.GE2366@paquier.xyz
Whole thread Raw
In response to Re: [HACKERS] Optional message to user when terminating/cancelling backend  (Thomas Munro <thomas.munro@enterprisedb.com>)
Responses Re: [HACKERS] Optional message to user when terminating/cancellingbackend  (Daniel Gustafsson <daniel@yesql.se>)
List pgsql-hackers
On Fri, Jul 06, 2018 at 12:18:02PM +1200, Thomas Munro wrote:
> 6118  --select pg_cancel_backend(pg_backend_pid(), 'it brings on many changes');
> 6119  select pg_cancel_backend(pg_backend_pid(), NULL);
> 6120! ERROR:  canceling statement due to user request
> 6121--- 25,32 ----
> 6122
> 6123  --select pg_cancel_backend(pg_backend_pid(), 'it brings on many changes');
> 6124  select pg_cancel_backend(pg_backend_pid(), NULL);
> 6125!  pg_cancel_backend
> 6126! -------------------
> 6127!  t
>
> Apparently Windows can take or leave it as it pleases.
>
> https://ci.appveyor.com/project/postgresql-cfbot/postgresql/build/1.0.4488

The test coverage looks adapted if it is possible to catch such
failures, so that's nice.

+select pg_cancel_backend();
+ERROR:  function pg_cancel_backend() does not exist
+LINE 1: select pg_cancel_backend();
This negative test is not really necessary.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Should contrib modules install .h files?
Next
From: Amit Langote
Date:
Subject: Re: documentation fixes for partition pruning, round three