*** a/src/bin/pg_ctl/pg_ctl.c
--- b/src/bin/pg_ctl/pg_ctl.c
***************
*** 549,557 **** test_postmaster_connection(bool do_checkpoint)
  		 */
  		if (i >= 5)
  		{
! 			struct stat statbuf;
  
! 			if (stat(pid_file, &statbuf) != 0)
  				return PQPING_NO_RESPONSE;
  		}
  
--- 549,558 ----
  		 */
  		if (i >= 5)
  		{
! 			pgpid_t	pid;
  
! 			pid = get_pgpid();
! 			if (pid == 0 || (pid > 0 && !postmaster_is_alive((pid_t) pid)))
  				return PQPING_NO_RESPONSE;
  		}
  
