*** /tmp/a5ON4C_lwlock.c	2015-07-31 11:23:46.424947872 -0400
--- src/backend/storage/lmgr/lwlock.c	2015-07-31 11:22:49.664973520 -0400
***************
*** 364,375 ****
  	numLocks += max_replication_slots;
  
  	/*
! 	 * Add any requested by loadable modules; for backwards-compatibility
! 	 * reasons, allocate at least NUM_USER_DEFINED_LWLOCKS of them even if
! 	 * there are no explicit requests.
  	 */
  	lock_addin_request_allowed = false;
! 	numLocks += Max(lock_addin_request, NUM_USER_DEFINED_LWLOCKS);
  
  	return numLocks;
  }
--- 364,378 ----
  	numLocks += max_replication_slots;
  
  	/*
! 	 * Add any requested by loadable modules by the explicit requested number.
! 	 * For backwards-compatibility reasons, allocate at least
! 	 * NUM_USER_DEFINED_LWLOCKS of them even if there are no explicit requests.
  	 */
  	lock_addin_request_allowed = false;
! 	if (lock_addin_request > 0)
! 		numLocks += lock_addin_request;
! 	else
! 		numLocks += NUM_USER_DEFINED_LWLOCKS;
  
  	return numLocks;
  }

