Make numeric power() handle NaNs according to the modern POSIX spec.
In commit 6bdf1303b, we ensured that power()/^ for float8 would honor
the NaN behaviors specified by POSIX standards released in this century,
ie NaN ^ 0 = 1 and 1 ^ NaN = 1. However, numeric_power() was not
touched and continued to follow the once-common behavior that every
case involving NaN input produces NaN. For consistency, let's switch
the numeric behavior to the modern spec in the same release that ensures
that behavior for float8.
(Note that while 6bdf1303b was initially back-patched, we later undid
that, concluding that any behavioral change should appear only in v11.)
src/backend/utils/adt/numeric.c | 21 +++++++++++++++++++--
src/test/regress/expected/numeric.out | 31 +++++++++++++++++++++++++++++++
src/test/regress/sql/numeric.sql | 7 +++++++
3 files changed, 57 insertions(+), 2 deletions(-)