--- src/backend/tcop/postgres.c~	2013-06-27 07:05:08.000000000 +0200
+++ src/backend/tcop/postgres.c	2013-06-27 17:10:28.040972642 +0200
@@ -2900,7 +2900,7 @@
 			DisableNotifyInterrupt();
 			DisableCatchupInterrupt();
 			ereport(ERROR,
-					(errcode(ERRCODE_QUERY_CANCELED),
+					(errcode(ERRCODE_LOCK_NOT_AVAILABLE),
 					 errmsg("canceling statement due to lock timeout")));
 		}
 		if (get_timeout_indicator(STATEMENT_TIMEOUT, true))
