From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
Subject: | pgsql: Support infinity and -infinity in the numeric data type. |
Date: | 2020-07-22 23:19:55 |
Message-ID: | E1jyO1j-0005O0-2s@gemulon.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
Support infinity and -infinity in the numeric data type.
Add infinities that behave the same as they do in the floating-point
data types. Aside from any intrinsic usefulness these may have,
this closes an important gap in our ability to convert floating
values to numeric and/or replace float-based APIs with numeric.
The new values are represented by bit patterns that were formerly
not used (although old code probably would take them for NaNs).
So there shouldn't be any pg_upgrade hazard.
Patch by me, reviewed by Dean Rasheed and Andrew Gierth
Discussion: https://postgr.es/m/606717.1591924582@sss.pgh.pa.us
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/a57d312a7706321d850faa048a562a0c0c01b835
Modified Files
--------------
contrib/jsonb_plperl/jsonb_plperl.c | 6 +-
contrib/jsonb_plpython/jsonb_plpython.c | 9 +-
doc/src/sgml/datatype.sgml | 75 +-
src/backend/utils/adt/formatting.c | 9 +-
src/backend/utils/adt/numeric.c | 1474 +++++++++++++++++++++++-------
src/include/utils/numeric.h | 1 +
src/test/regress/expected/aggregates.out | 86 +-
src/test/regress/expected/numeric.out | 680 +++++++++++++-
src/test/regress/expected/window.out | 66 +-
src/test/regress/sql/aggregates.sql | 22 +-
src/test/regress/sql/numeric.sql | 187 +++-
src/test/regress/sql/window.sql | 16 +-
12 files changed, 2251 insertions(+), 380 deletions(-)
From | Date | Subject | |
---|---|---|---|
Next Message | Michael Paquier | 2020-07-22 23:31:21 | pgsql: Revert "Fix corner case with PGP decompression in pgcrypto" |
Previous Message | Michael Paquier | 2020-07-22 05:54:41 | pgsql: Fix corner case with PGP decompression in pgcrypto |