diff --git a/src/backend/utils/adt/float.c b/src/backend/utils/adt/float.c
index 080d7977a199b3798cbf237d9ec5c2fc3d7e947e..8aa17e1dcb903a6051afb2ff7429808b5b816c54 100644
--- a/src/backend/utils/adt/float.c
+++ b/src/backend/utils/adt/float.c
@@ -1461,25 +1461,6 @@ dpow(PG_FUNCTION_ARGS)
 	float8		arg2 = PG_GETARG_FLOAT8(1);
 	float8		result;
 
-	/*
-	 * The POSIX spec says that NaN ^ 0 = 1, and 1 ^ NaN = 1, while all other
-	 * cases with NaN inputs yield NaN (with no error).  Many older platforms
-	 * get one or more of these cases wrong, so deal with them via explicit
-	 * logic rather than trusting pow(3).
-	 */
-	if (isnan(arg1))
-	{
-		if (isnan(arg2) || arg2 != 0.0)
-			PG_RETURN_FLOAT8(get_float8_nan());
-		PG_RETURN_FLOAT8(1.0);
-	}
-	if (isnan(arg2))
-	{
-		if (arg1 != 1.0)
-			PG_RETURN_FLOAT8(get_float8_nan());
-		PG_RETURN_FLOAT8(1.0);
-	}
-
 	/*
 	 * The SQL spec requires that we emit a particular SQLSTATE error code for
 	 * certain error conditions.  Specifically, we don't return a
@@ -1498,7 +1479,7 @@ dpow(PG_FUNCTION_ARGS)
 	 * pow() sets errno only on some platforms, depending on whether it
 	 * follows _IEEE_, _POSIX_, _XOPEN_, or _SVID_, so we try to avoid using
 	 * errno.  However, some platform/CPU combinations return errno == EDOM
-	 * and result == NaN for negative arg1 and very large arg2 (they must be
+	 * and result == Nan for negative arg1 and very large arg2 (they must be
 	 * using something different from our floor() test to decide it's
 	 * invalid).  Other platforms (HPPA) return errno == ERANGE and a large
 	 * (HUGE_VAL) but finite result to signal overflow.
diff --git a/src/test/regress/expected/float8-exp-three-digits-win32.out b/src/test/regress/expected/float8-exp-three-digits-win32.out
index 3896cdec7216296b19a796884f6242d8b6499219..7e1153308f55f4f374f1e80636ee16c195649b2b 100644
--- a/src/test/regress/expected/float8-exp-three-digits-win32.out
+++ b/src/test/regress/expected/float8-exp-three-digits-win32.out
@@ -340,42 +340,6 @@ SELECT power(float8 '144', float8 '0.5');
     12
 (1 row)
 
-SELECT power(float8 'NaN', float8 '0.5');
- power 
--------
-   NaN
-(1 row)
-
-SELECT power(float8 '144', float8 'NaN');
- power 
--------
-   NaN
-(1 row)
-
-SELECT power(float8 'NaN', float8 'NaN');
- power 
--------
-   NaN
-(1 row)
-
-SELECT power(float8 '-1', float8 'NaN');
- power 
--------
-   NaN
-(1 row)
-
-SELECT power(float8 '1', float8 'NaN');
- power 
--------
-     1
-(1 row)
-
-SELECT power(float8 'NaN', float8 '0');
- power 
--------
-     1
-(1 row)
-
 -- take exp of ln(f.f1)
 SELECT '' AS three, f.f1, exp(ln(f.f1)) AS exp_ln_f1
    FROM FLOAT8_TBL f
diff --git a/src/test/regress/expected/float8-small-is-zero.out b/src/test/regress/expected/float8-small-is-zero.out
index f8e09390f518c054569594db469e110788de2d6d..26b83781500c5b884096981a7bf74bdae30a6499 100644
--- a/src/test/regress/expected/float8-small-is-zero.out
+++ b/src/test/regress/expected/float8-small-is-zero.out
@@ -344,42 +344,6 @@ SELECT power(float8 '144', float8 '0.5');
     12
 (1 row)
 
-SELECT power(float8 'NaN', float8 '0.5');
- power 
--------
-   NaN
-(1 row)
-
-SELECT power(float8 '144', float8 'NaN');
- power 
--------
-   NaN
-(1 row)
-
-SELECT power(float8 'NaN', float8 'NaN');
- power 
--------
-   NaN
-(1 row)
-
-SELECT power(float8 '-1', float8 'NaN');
- power 
--------
-   NaN
-(1 row)
-
-SELECT power(float8 '1', float8 'NaN');
- power 
--------
-     1
-(1 row)
-
-SELECT power(float8 'NaN', float8 '0');
- power 
--------
-     1
-(1 row)
-
 -- take exp of ln(f.f1)
 SELECT '' AS three, f.f1, exp(ln(f.f1)) AS exp_ln_f1
    FROM FLOAT8_TBL f
diff --git a/src/test/regress/expected/float8-small-is-zero_1.out b/src/test/regress/expected/float8-small-is-zero_1.out
index ebfec4cdb6899ba5a53834751c014e999a5dafee..cea27908ebf1df102fa54d16d0212abc7c4a4d3f 100644
--- a/src/test/regress/expected/float8-small-is-zero_1.out
+++ b/src/test/regress/expected/float8-small-is-zero_1.out
@@ -344,42 +344,6 @@ SELECT power(float8 '144', float8 '0.5');
     12
 (1 row)
 
-SELECT power(float8 'NaN', float8 '0.5');
- power 
--------
-   NaN
-(1 row)
-
-SELECT power(float8 '144', float8 'NaN');
- power 
--------
-   NaN
-(1 row)
-
-SELECT power(float8 'NaN', float8 'NaN');
- power 
--------
-   NaN
-(1 row)
-
-SELECT power(float8 '-1', float8 'NaN');
- power 
--------
-   NaN
-(1 row)
-
-SELECT power(float8 '1', float8 'NaN');
- power 
--------
-     1
-(1 row)
-
-SELECT power(float8 'NaN', float8 '0');
- power 
--------
-     1
-(1 row)
-
 -- take exp of ln(f.f1)
 SELECT '' AS three, f.f1, exp(ln(f.f1)) AS exp_ln_f1
    FROM FLOAT8_TBL f
diff --git a/src/test/regress/expected/float8.out b/src/test/regress/expected/float8.out
index b05831d45c954918bc65f0f168fb6f711a6fd4d9..20c985e5df86ee6bcf603f45bec4df2947e1fad0 100644
--- a/src/test/regress/expected/float8.out
+++ b/src/test/regress/expected/float8.out
@@ -340,42 +340,6 @@ SELECT power(float8 '144', float8 '0.5');
     12
 (1 row)
 
-SELECT power(float8 'NaN', float8 '0.5');
- power 
--------
-   NaN
-(1 row)
-
-SELECT power(float8 '144', float8 'NaN');
- power 
--------
-   NaN
-(1 row)
-
-SELECT power(float8 'NaN', float8 'NaN');
- power 
--------
-   NaN
-(1 row)
-
-SELECT power(float8 '-1', float8 'NaN');
- power 
--------
-   NaN
-(1 row)
-
-SELECT power(float8 '1', float8 'NaN');
- power 
--------
-     1
-(1 row)
-
-SELECT power(float8 'NaN', float8 '0');
- power 
--------
-     1
-(1 row)
-
 -- take exp of ln(f.f1)
 SELECT '' AS three, f.f1, exp(ln(f.f1)) AS exp_ln_f1
    FROM FLOAT8_TBL f
diff --git a/src/test/regress/sql/float8.sql b/src/test/regress/sql/float8.sql
index eeebddd4b78d334ee73a777403b55060475c101a..215e7a478499a1cebb91c19f571dfbdbbb7a29f8 100644
--- a/src/test/regress/sql/float8.sql
+++ b/src/test/regress/sql/float8.sql
@@ -108,12 +108,6 @@ SELECT '' AS three, f.f1, |/f.f1 AS sqrt_f1
 
 -- power
 SELECT power(float8 '144', float8 '0.5');
-SELECT power(float8 'NaN', float8 '0.5');
-SELECT power(float8 '144', float8 'NaN');
-SELECT power(float8 'NaN', float8 'NaN');
-SELECT power(float8 '-1', float8 'NaN');
-SELECT power(float8 '1', float8 'NaN');
-SELECT power(float8 'NaN', float8 '0');
 
 -- take exp of ln(f.f1)
 SELECT '' AS three, f.f1, exp(ln(f.f1)) AS exp_ln_f1