Index: src/backend/utils/adt/float.c
===================================================================
RCS file: /cvsroot/pgsql/src/backend/utils/adt/float.c,v
retrieving revision 1.155
diff -c -c -r1.155 float.c
*** src/backend/utils/adt/float.c	21 Apr 2008 00:26:45 -0000	1.155
--- src/backend/utils/adt/float.c	9 May 2008 15:34:53 -0000
***************
*** 1331,1337 ****
  
  	/*
  	 * The SQL spec requires that we emit a particular SQLSTATE error code for
! 	 * certain error conditions.
  	 */
  	if ((arg1 == 0 && arg2 < 0) ||
  		(arg1 < 0 && floor(arg2) != arg2))
--- 1331,1338 ----
  
  	/*
  	 * The SQL spec requires that we emit a particular SQLSTATE error code for
! 	 * certain error conditions.  Specifically, we don't return a divide-by-zero
! 	 * error code for 0 ^ -1.
  	 */
  	if ((arg1 == 0 && arg2 < 0) ||
  		(arg1 < 0 && floor(arg2) != arg2))
Index: src/backend/utils/adt/numeric.c
===================================================================
RCS file: /cvsroot/pgsql/src/backend/utils/adt/numeric.c,v
retrieving revision 1.112
diff -c -c -r1.112 numeric.c
*** src/backend/utils/adt/numeric.c	8 May 2008 22:17:54 -0000	1.112
--- src/backend/utils/adt/numeric.c	9 May 2008 15:34:53 -0000
***************
*** 1893,1900 ****
  	trunc_var(&arg2_trunc, 0);
  
  	/*
! 	 * Return special SQLSTATE error codes for a few conditions mandated by
! 	 * the standard.
  	 */
  	if ((cmp_var(&arg1, &const_zero) == 0 &&
  		 cmp_var(&arg2, &const_zero) < 0) ||
--- 1893,1901 ----
  	trunc_var(&arg2_trunc, 0);
  
  	/*
! 	 * The SQL spec requires that we emit a particular SQLSTATE error code for
! 	 * certain error conditions.  Specifically, we don't return a divide-by-zero
! 	 * error code for 0 ^ -1.
  	 */
  	if ((cmp_var(&arg1, &const_zero) == 0 &&
  		 cmp_var(&arg2, &const_zero) < 0) ||
***************
*** 5283,5288 ****
--- 5284,5290 ----
  			/*
  			 *	While 0 ^ 0 can be either 1 or indeterminate (error), we
  			 *	treat it as 1 because most programming languages do this.
+ 			 *	SQL:2003 also requires a return value of 1.
  			 *	http://en.wikipedia.org/wiki/Exponentiation#Zero_to_the_zero_power
  			 */
  			set_var_from_var(&const_one, result);
