diff --git a/src/backend/storage/lmgr/proc.c b/src/backend/storage/lmgr/proc.c
index e608198..613b36a 100644
--- a/src/backend/storage/lmgr/proc.c
+++ b/src/backend/storage/lmgr/proc.c
@@ -279,6 +279,14 @@ InitProcess(void)
 {
 	/* use volatile pointer to prevent code rearrangement */
 	volatile PROC_HDR *procglobal = ProcGlobal;
+#define LIST_TYPE_ENTRY(e) [(e)] = (#e)
+	enum listType { autovac, bgworker, backend } which;
+	char const * const listTypeNames[] = {
+		LIST_TYPE_ENTRY(autovac),
+		LIST_TYPE_ENTRY(bgworker),
+		LIST_TYPE_ENTRY(backend)
+	};
+#undef LIST_TYPE_ENTRY
 
 	/*
 	 * ProcGlobal should be set up already (if we are a backend, we inherit
@@ -309,11 +317,11 @@ InitProcess(void)
 	set_spins_per_delay(procglobal->spins_per_delay);
 
 	if (IsAnyAutoVacuumProcess())
-		MyProc = procglobal->autovacFreeProcs;
+		which = autovac, MyProc = procglobal->autovacFreeProcs;
 	else if (IsBackgroundWorker)
-		MyProc = procglobal->bgworkerFreeProcs;
+		which = bgworker, MyProc = procglobal->bgworkerFreeProcs;
 	else
-		MyProc = procglobal->freeProcs;
+		which = backend, MyProc = procglobal->freeProcs;
 
 	if (MyProc != NULL)
 	{
@@ -330,13 +338,13 @@ InitProcess(void)
 		/*
 		 * If we reach here, all the PGPROCs are in use.  This is one of the
 		 * possible places to detect "too many backends", so give the standard
-		 * error message.  XXX do we need to give a different failure message
-		 * in the autovacuum case?
+		 * error message.
 		 */
 		SpinLockRelease(ProcStructLock);
 		ereport(FATAL,
 				(errcode(ERRCODE_TOO_MANY_CONNECTIONS),
-				 errmsg("sorry, too many clients already")));
+				 errmsg("sorry, too many clients already"),
+				 errdetail("%s proc list saturated", listTypeNames[which])));
 	}
 	MyPgXact = &ProcGlobal->allPgXact[MyProc->pgprocno];
 
