PostgreSQL Bugs

Collected from the PG bugs email list.

Bug ID15492
PG Version11.0
OSWindows 2012 R2
Opened2018-11-08 04:30:05+00
Reported byAlexander Lakhin
StatusOpen

Body of first available message related to this bug follows.

The following bug has been logged on the website:

Bug reference:      15492
Logged by:          Alexander Lakhin
Email address:      (redacted)
PostgreSQL version: 11.0
Operating system:   Windows 2012 R2
Description:        

When performing `make standbycheck` I get sporadic failure:

============== running regression test queries        ==============
test hs_standby_check         ... ok
test hs_standby_allowed       ... ok
test hs_standby_disallowed    ... ok
test hs_standby_functions     ... FAILED

======================
 1 of 4 tests failed. 
======================

***
C:/tmp/postgrespro-standard-10.6.1/src/test/regress/expected/hs_standby_functions.out	Wed
Nov  7 01:14:03 2018
---
C:/tmp/postgrespro-standard-10.6.1/src/test/regress/results/hs_standby_functions.out	Wed
Nov  7 06:36:47 2018
***************
*** 37,40 ****
  
  -- suicide is painless
  select pg_cancel_backend(pg_backend_pid());
! ERROR:  canceling statement due to user request
--- 37,44 ----

  -- suicide is painless
  select pg_cancel_backend(pg_backend_pid());
!  pg_cancel_backend 
! -------------------
!  t
! (1 row)
! 

======================================================================

In fact, I see the same when I just do in psql (using EnterpriseDB's
PostgreSQL 11 for Windows):

postgres=# select pg_cancel_backend(pg_backend_pid());
ERROR:  canceling statement due to user request
postgres=# select pg_cancel_backend(pg_backend_pid());
ERROR:  canceling statement due to user request
postgres=# select pg_cancel_backend(pg_backend_pid());
ERROR:  canceling statement due to user request
postgres=# select pg_cancel_backend(pg_backend_pid());
 pg_cancel_backend
-------------------
 t
(1 row)


postgres=# select pg_cancel_backend(pg_backend_pid());
 pg_cancel_backend
-------------------
 t
(1 row)


postgres=# select pg_cancel_backend(pg_backend_pid());
ERROR:  canceling statement due to user request
postgres=#

I couldn't reproduce it on Linux, though.
So if it's an expected behaviour, shouldn't the hs_standby_functions check
be fixed?
(I don't understand what is the point of this pg_cancel_backend call.)

Messages

DateAuthorSubject
2018-11-08 04:30:05+00=?utf-8?q?PG_Bug_reporting_form?=BUG #15492: pg_cancel_backend(pg_backend_pid()) returns true sporadically
2018-11-08 10:31:41+00Magnus HaganderRe: BUG #15492: pg_cancel_backend(pg_backend_pid()) returns true sporadically
2018-11-09 01:20:58+00Michael PaquierRe: BUG #15492: pg_cancel_backend(pg_backend_pid()) returns true sporadically
2018-11-09 01:25:08+00Thomas MunroRe: BUG #15492: pg_cancel_backend(pg_backend_pid()) returns true sporadically
2018-11-09 14:43:39+00Magnus HaganderRe: BUG #15492: pg_cancel_backend(pg_backend_pid()) returns true sporadically
2018-11-09 14:48:49+00Magnus HaganderRe: BUG #15492: pg_cancel_backend(pg_backend_pid()) returns true sporadically
2018-11-09 14:49:47+00Tom LaneRe: BUG #15492: pg_cancel_backend(pg_backend_pid()) returns true sporadically
2018-11-12 03:40:00+00Alexander LakhinRe: BUG #15492: pg_cancel_backend(pg_backend_pid()) returns true sporadically
2018-11-12 04:01:21+00Alexander LakhinRe: BUG #15492: pg_cancel_backend(pg_backend_pid()) returns true sporadically
2018-11-12 05:19:25+00Michael PaquierRe: BUG #15492: pg_cancel_backend(pg_backend_pid()) returns true sporadically