pgsql: Centralize definition of integer limits. - Mailing list pgsql-committers

From Andres Freund
Subject pgsql: Centralize definition of integer limits.
Date
Msg-id E1YatAv-0007cu-KW@gemulon.postgresql.org
Whole thread Raw
Responses Re: pgsql: Centralize definition of integer limits.
List pgsql-committers
Centralize definition of integer limits.

Several submitted and even committed patches have run into the problem
that C89, our baseline, does not provide minimum/maximum values for
various integer datatypes. C99's stdint.h does, but we can't rely on
it.

Several parts of the code defined limits locally, so instead centralize
the definitions to c.h.

This patch also changes the more obvious usages of literal limit values;
there's more places that could be changed, but it's less clear whether
it's beneficial to change those.

Author: Andrew Gierth
Discussion: 87619tc5wc.fsf@news-spur.riddles.org.uk

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/83ff1618bc9d4e530d3ef2a668a71326784a753c

Modified Files
--------------
contrib/btree_gist/btree_ts.c             |    4 +--
contrib/intarray/_int_gist.c              |    4 ++-
contrib/pgbench/pgbench.c                 |    6 +----
src/backend/access/transam/xlog.c         |    2 +-
src/backend/tsearch/wparser_def.c         |    6 +++--
src/backend/utils/adt/int8.c              |    2 +-
src/backend/utils/adt/numutils.c          |    2 +-
src/backend/utils/adt/timestamp.c         |    8 ------
src/backend/utils/adt/tsrank.c            |    3 ++-
src/backend/utils/adt/txid.c              |    2 +-
src/include/c.h                           |   41 +++++++++++++++++++++++++++++
src/include/datatype/timestamp.h          |    4 +--
src/include/executor/instrument.h         |    2 +-
src/include/nodes/parsenodes.h            |    2 +-
src/include/pg_config_manual.h            |    4 +--
src/include/port/atomics.h                |    4 +--
src/include/storage/predicate_internals.h |    2 +-
src/include/utils/date.h                  |    6 ++---
18 files changed, 68 insertions(+), 36 deletions(-)


pgsql-committers by date:

Previous
From: Alvaro Herrera
Date:
Subject: pgsql: Return ObjectAddress in many ALTER TABLE sub-routines
Next
From: Tom Lane
Date:
Subject: pgsql: Add an ASSERT statement in plpgsql.