diff --git a/src/backend/storage/lmgr/lock.c b/src/backend/storage/lmgr/lock.c
index 2057329222710248831fe159148df300e5ac4770..640c36e5d1a10c907e5c4942489961c0dd98fc7c 100644
--- a/src/backend/storage/lmgr/lock.c
+++ b/src/backend/storage/lmgr/lock.c
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *	  $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lock.c,v 1.18 1998/01/07 21:05:32 momjian Exp $
+ *	  $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lock.c,v 1.19 1998/01/23 06:01:03 momjian Exp $
  *
  * NOTES
  *	  Outside modules can create a lock table and acquire/release
@@ -48,8 +48,7 @@
 #include "access/xact.h"
 #include "access/transam.h"
 
-static int
-WaitOnLock(LOCKTAB *ltable, LockTableId tableId, LOCK *lock,
+static int WaitOnLock(LOCKTAB *ltable, LockTableId tableId, LOCK *lock,
 		   LOCKT lockt);
 		   
 /*#define LOCK_MGR_DEBUG*/
diff --git a/src/backend/storage/lmgr/proc.c b/src/backend/storage/lmgr/proc.c
index 7d91398b228da2cbeabfa2eccfc8fbafb423922f..1df06815bff1544533b97801d83dd18a4d9104d5 100644
--- a/src/backend/storage/lmgr/proc.c
+++ b/src/backend/storage/lmgr/proc.c
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *	  $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.25 1998/01/07 21:05:36 momjian Exp $
+ *	  $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.26 1998/01/23 06:01:05 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -46,7 +46,7 @@
  *		This is so that we can support more backends. (system-wide semaphore
  *		sets run out pretty fast.)				  -ay 4/95
  *
- * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.25 1998/01/07 21:05:36 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.26 1998/01/23 06:01:05 momjian Exp $
  */
 #include <sys/time.h>
 #include <unistd.h>
@@ -729,7 +729,8 @@ HandleDeadLock(int sig)
 	 */
 	UnlockLockTable();
 
-	elog(NOTICE, "Timeout -- possible deadlock");
+	elog(NOTICE, "Timeout interval reached -- possible deadlock.");
+	elog(NOTICE, "See the lock(l) manual page for a possible cause.");
 	return;
 }
 
diff --git a/src/include/storage/proc.h b/src/include/storage/proc.h
index 5a7c85b0b1bba9e16845d374500822b5044acbce..e58758a8c606bc1a8b075140e4c0b870103600de 100644
--- a/src/include/storage/proc.h
+++ b/src/include/storage/proc.h
@@ -6,7 +6,7 @@
  *
  * Copyright (c) 1994, Regents of the University of California
  *
- * $Id: proc.h,v 1.8 1997/09/08 21:54:32 momjian Exp $
+ * $Id: proc.h,v 1.9 1998/01/23 06:01:25 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -102,8 +102,7 @@ extern bool ProcRemove(int pid);
 /* make static in storage/lmgr/proc.c -- jolly */
 
 extern void ProcQueueInit(PROC_QUEUE *queue);
-extern int
-ProcSleep(PROC_QUEUE *queue, SPINLOCK spinlock, int token,
+extern int ProcSleep(PROC_QUEUE *queue, SPINLOCK spinlock, int token,
 		  int prio, LOCK *lock);
 extern int	ProcLockWakeup(PROC_QUEUE *queue, char *ltable, char *lock);
 extern void ProcAddLock(SHM_QUEUE *elem);
diff --git a/src/man/lock.l b/src/man/lock.l
new file mode 100644
index 0000000000000000000000000000000000000000..8882cf15fb7840cc667a7c94d97161f31ebd7b47
--- /dev/null
+++ b/src/man/lock.l
@@ -0,0 +1,33 @@
+.\" This is -*-nroff-*-
+.\" XXX standard disclaimer belongs here....
+.\" $Header: /cvsroot/pgsql/src/man/Attic/lock.l,v 1.1 1998/01/23 06:01:36 momjian Exp $
+.TH FETCH SQL 01/23/93 PostgreSQL PostgreSQL
+.SH NAME
+lock - exclusive lock a table
+.SH SYNOPSIS
+.nf
+\fBlock\fR classname
+.fi
+.SH DESCRIPTION
+.BR lock
+exclusive locks a table inside a transaction. The classic use for this
+is the case where you want to \fBselect\fP some data, then update it
+inside a transaction.  If you don't exclusive lock the table before the
+\fBselect\fP, some other user may also read the selected data, and try
+and do their own \fBupdate\fP, causing a deadlock while you both wait
+for the other to release the \fBselect\fP-induced shared lock so you can
+get an exclusive lock to do the \fBupdate.\fP
+.SH EXAMPLES
+.nf
+--
+--  Proper locking to prevent deadlock
+--
+begin work;
+lock mytable;
+select * from mytable;
+update mytable set (x = 100);
+end work;
+.SH "SEE ALSO"
+begin(l),
+end(l),
+select(l).