diff --git a/src/bin/pg_ctl/pg_ctl.c b/src/bin/pg_ctl/pg_ctl.c
index 14d36b5..df71c16 100644
*** a/src/bin/pg_ctl/pg_ctl.c
--- b/src/bin/pg_ctl/pg_ctl.c
*************** typedef enum
*** 70,75 ****
--- 70,78 ----
  } CtlCommand;
  
  #define DEFAULT_WAIT	60
+ //
+ ///* This is part of the protocol so just define it */
+ //#define ERRCODE_INVALID_PASSWORD "28P01"
  
  static bool do_wait = false;
  static bool wait_set = false;
*************** test_postmaster_connection(bool do_check
*** 511,516 ****
--- 514,523 ----
  		if ((conn = PQconnectdb(connstr)) != NULL &&
  			(PQstatus(conn) == CONNECTION_OK ||
  			 PQconnectionNeedsPassword(conn)))
+ //			/* only works with >= 9.0 servers */
+ //			(PQgetResult(conn) &&
+ //			strcmp(PQresultErrorField(PQgetResult(conn), PG_DIAG_SQLSTATE),
+ //			   ERRCODE_INVALID_PASSWORD) == 0)))
  		{
  			PQfinish(conn);
  			success = true;
*************** test_postmaster_connection(bool do_check
*** 518,523 ****
--- 525,533 ----
  		}
  		else
  		{
+ 			/* report fatal errors like invalid .pgpass passwords */
+ 			if (strncmp(PQerrorMessage(conn), "FATAL:", strlen("FATAL:")) == 0)
+ 				fputs(PQerrorMessage(conn), stderr);
  			PQfinish(conn);
  
  #if defined(WIN32)
