pgsql: Provide separate header file for built-in float types

From: Tomas Vondra <tomas(dot)vondra(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Provide separate header file for built-in float types
Date: 2018-07-29 01:43:52
Message-ID: E1fjakS-0002PG-Kh@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Provide separate header file for built-in float types

Some data types under adt/ have separate header files, but most simple
ones do not, and their public functions are defined in builtins.h. As
the patches improving geometric types will require making additional
functions public, this seems like a good opportunity to create a header
for floats types.

Commit 1acf757255 made _cmp functions public to solve NaN issues locally
for GiST indexes. This patch reworks it in favour of a more widely
applicable API. The API uses inline functions, as they are easier to
use compared to macros, and avoid double-evaluation hazards.

Author: Emre Hasegeli
Reviewed-by: Kyotaro Horiguchi

Discussion: https://www.postgresql.org/message-id/CAE2gYzxF7-5djV6-cEvqQu-fNsnt%3DEqbOURx7ZDg%2BVv6ZMTWbg%40mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/6bf0bc842bd75877e31727eb559c6a69e237f831

Modified Files
--------------
contrib/btree_gin/btree_gin.c | 1 +
contrib/btree_gist/btree_ts.c | 1 +
contrib/cube/cube.c | 2 +-
contrib/cube/cubeparse.y | 2 +-
contrib/postgres_fdw/postgres_fdw.c | 1 +
src/backend/access/gist/gistget.c | 2 +-
src/backend/access/gist/gistproc.c | 56 ++-
src/backend/access/gist/gistutil.c | 2 +-
src/backend/utils/adt/float.c | 589 ++++++--------------------
src/backend/utils/adt/formatting.c | 1 +
src/backend/utils/adt/geo_ops.c | 7 +-
src/backend/utils/adt/geo_spgist.c | 3 +-
src/backend/utils/adt/numeric.c | 1 +
src/backend/utils/adt/rangetypes_gist.c | 3 +-
src/backend/utils/adt/rangetypes_selfuncs.c | 3 +-
src/backend/utils/adt/rangetypes_typanalyze.c | 3 +-
src/backend/utils/adt/timestamp.c | 1 +
src/backend/utils/misc/guc.c | 1 +
src/include/utils/builtins.h | 14 -
src/include/utils/float.h | 376 ++++++++++++++++
20 files changed, 556 insertions(+), 513 deletions(-)

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Noah Misch 2018-07-29 03:14:03 pgsql: Document security implications of qualified names.
Previous Message Tomas Vondra 2018-07-29 00:43:29 pgsql: Refactor geometric functions and operators