pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Support infinity and -infinity in the numeric data type.
Date: Wed, 22 Jul 2020 23:19:55 +0000
Message-ID: <E1jyO1j-0005O0-2s@gemulon.postgresql.org> (raw)

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(-)



Message-ID: <E1jyO1j-0005O0-2s@gemulon.postgresql.org>
Permalink:  ../E1jyO1j-0005O0-2s@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1jyO1j-0005O0-2s@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Support infinity and -infinity in the numeric data type.
  In-Reply-To: <E1jyO1j-0005O0-2s@gemulon.postgresql.org>
  References: <E1jyO1j-0005O0-2s@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox