diff -rpcd a/src/backend/utils/error/elog.c b/src/backend/utils/error/elog.c
*** a/src/backend/utils/error/elog.c	2013-06-25 03:55:41.000000000 +0900
--- b/src/backend/utils/error/elog.c	2013-09-06 17:02:54.000000000 +0900
*************** expand_fmt_string(const char *fmt, Error
*** 2927,2934 ****
  static const char *
  useful_strerror(int errnum)
  {
! 	/* this buffer is only used if errno has a bogus value */
! 	static char errorstr_buf[48];
  	const char *str;
  
  #ifdef WIN32
--- 2927,2933 ----
  static const char *
  useful_strerror(int errnum)
  {
! 	static char errorstr_buf[512];
  	const char *str;
  
  #ifdef WIN32
*************** useful_strerror(int errnum)
*** 2949,2956 ****
  		  translator: This string will be truncated at 47
  		  characters expanded. */
  				 _("operating system error %d"), errnum);
- 		str = errorstr_buf;
  	}
  
  	return str;
  }
--- 2948,2958 ----
  		  translator: This string will be truncated at 47
  		  characters expanded. */
  				 _("operating system error %d"), errnum);
  	}
+ 	else
+ 		snprintf(errorstr_buf, sizeof(errorstr_buf), "errno=%d: %s",
+ 				 errno, str);
+ 	str = errorstr_buf;
  
  	return str;
  }
