diff --git a/src/backend/storage/ipc/shmem.c b/src/backend/storage/ipc/shmem.c
index 16df9e9d424db59ef03690257126eca081315183..a25c78e07236a20d9e28433cfe57f80bfcc59e58 100644
--- a/src/backend/storage/ipc/shmem.c
+++ b/src/backend/storage/ipc/shmem.c
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *	  $Header: /cvsroot/pgsql/src/backend/storage/ipc/shmem.c,v 1.72 2003/09/25 06:58:02 petere Exp $
+ *	  $Header: /cvsroot/pgsql/src/backend/storage/ipc/shmem.c,v 1.73 2003/10/16 20:59:35 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -167,7 +167,7 @@ ShmemAlloc(Size size)
 	if (!newSpace)
 		ereport(WARNING,
 				(errcode(ERRCODE_OUT_OF_MEMORY),
-				 errmsg("out of memory")));
+				 errmsg("out of shared memory")));
 
 	return newSpace;
 }
@@ -226,7 +226,7 @@ InitShmemIndex(void)
 	if (!result)
 		ereport(FATAL,
 				(errcode(ERRCODE_OUT_OF_MEMORY),
-				 errmsg("out of memory")));
+				 errmsg("out of shared memory")));
 
 	Assert(ShmemBootstrap && !found);
 
@@ -346,7 +346,7 @@ ShmemInitStruct(const char *name, Size size, bool *foundPtr)
 		LWLockRelease(ShmemIndexLock);
 		ereport(ERROR,
 				(errcode(ERRCODE_OUT_OF_MEMORY),
-				 errmsg("out of memory")));
+				 errmsg("out of shared memory")));
 		return NULL;
 	}
 
diff --git a/src/backend/storage/lmgr/lock.c b/src/backend/storage/lmgr/lock.c
index 8650931e2be422f6239772f10a5e5cbeddf1de03..020c7a5d896c51f6fdb4660b407b72096a28e5c2 100644
--- a/src/backend/storage/lmgr/lock.c
+++ b/src/backend/storage/lmgr/lock.c
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *	  $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lock.c,v 1.127 2003/08/17 22:41:12 tgl Exp $
+ *	  $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lock.c,v 1.128 2003/10/16 20:59:35 tgl Exp $
  *
  * NOTES
  *	  Outside modules can create a lock table and acquire/release
@@ -476,8 +476,8 @@ LockAcquire(LOCKMETHOD lockmethod, LOCKTAG *locktag,
 		LWLockRelease(masterLock);
 		ereport(ERROR,
 				(errcode(ERRCODE_OUT_OF_MEMORY),
-				 errmsg("out of memory")));
-		return FALSE;
+				 errmsg("out of shared memory"),
+				 errhint("You may need to increase max_locks_per_transaction.")));
 	}
 
 	/*
@@ -524,8 +524,8 @@ LockAcquire(LOCKMETHOD lockmethod, LOCKTAG *locktag,
 		LWLockRelease(masterLock);
 		ereport(ERROR,
 				(errcode(ERRCODE_OUT_OF_MEMORY),
-				 errmsg("out of memory")));
-		return FALSE;
+				 errmsg("out of shared memory"),
+				 errhint("You may need to increase max_locks_per_transaction.")));
 	}
 
 	/*
diff --git a/src/backend/storage/lmgr/proc.c b/src/backend/storage/lmgr/proc.c
index 32b08d6c6c16dab7ae8a94d44dcaf0f7e3211c9c..6ffac1d43cf29fb0b2c9b710aaa0401222b4d39d 100644
--- a/src/backend/storage/lmgr/proc.c
+++ b/src/backend/storage/lmgr/proc.c
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *	  $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.135 2003/10/11 18:04:25 momjian Exp $
+ *	  $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.136 2003/10/16 20:59:35 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -151,7 +151,7 @@ InitProcGlobal(int maxBackends)
 			if (!proc)
 				ereport(FATAL,
 						(errcode(ERRCODE_OUT_OF_MEMORY),
-						 errmsg("out of memory")));
+						 errmsg("out of shared memory")));
 			MemSet(proc, 0, sizeof(PGPROC));
 			PGSemaphoreCreate(&proc->sem);
 			proc->links.next = ProcGlobal->freeProcs;
@@ -167,7 +167,7 @@ InitProcGlobal(int maxBackends)
 		if (!DummyProc)
 			ereport(FATAL,
 					(errcode(ERRCODE_OUT_OF_MEMORY),
-					 errmsg("out of memory")));
+					 errmsg("out of shared memory")));
 		MemSet(DummyProc, 0, sizeof(PGPROC));
 		DummyProc->pid = 0;		/* marks DummyProc as not in use */
 		PGSemaphoreCreate(&DummyProc->sem);