diff --git a/src/backend/access/transam/xlogfuncs.c b/src/backend/access/transam/xlogfuncs.c index 5044ff0643..0095d4ff3c 100644 --- a/src/backend/access/transam/xlogfuncs.c +++ b/src/backend/access/transam/xlogfuncs.c @@ -711,10 +711,9 @@ pg_promote(PG_FUNCTION_ARGS) /* signal the postmaster */ if (kill(PostmasterPid, SIGUSR1) != 0) { - ereport(WARNING, - (errmsg("failed to send signal to postmaster: %m"))); (void) unlink(PROMOTE_SIGNAL_FILE); - PG_RETURN_BOOL(false); + ereport(ERROR, + (errmsg("failed to send signal to postmaster: %m"))); } /* return immediately if waiting was not requested */ @@ -744,7 +743,9 @@ pg_promote(PG_FUNCTION_ARGS) * necessity for manual cleanup of all postmaster children. */ if (rc & WL_POSTMASTER_DEATH) - PG_RETURN_BOOL(false); + ereport(FATAL, + (errcode(ERRCODE_ADMIN_SHUTDOWN), + errmsg("terminating connection due to unexpected postmaster exit"))); } ereport(WARNING,