Convert *GetDatum() and DatumGet*() macros to inline functions
authorPeter Eisentraut <peter@eisentraut.org>
Mon, 12 Sep 2022 15:35:55 +0000 (17:35 +0200)
committerPeter Eisentraut <peter@eisentraut.org>
Mon, 12 Sep 2022 15:36:26 +0000 (17:36 +0200)
commit595836e99bf1ee6d43405b885fb69bb8c6d3ee23
tree9af38bcdaab9e75913c66b29f30caf1f9f4e5409
parent8cb2a22bbb2cf4212482ac15021ceaa2e9c52209
Convert *GetDatum() and DatumGet*() macros to inline functions

The previous macro implementations just cast the argument to a target
type but did not check whether the input type was appropriate.  The
function implementation can do better type checking of the input type.

Reviewed-by: Aleksander Alekseev <aleksander@timescale.com>
Discussion: https://www.postgresql.org/message-id/flat/8528fb7e-0aa2-6b54-85fb-0c0886dbd6ed%40enterprisedb.com
27 files changed:
contrib/intarray/_int_gist.c
doc/src/sgml/xfunc.sgml
src/backend/access/gist/gistutil.c
src/backend/tsearch/ts_parse.c
src/backend/utils/mb/mbutils.c
src/include/access/gin.h
src/include/funcapi.h
src/include/postgres.h
src/include/tsearch/ts_type.h
src/include/tsearch/ts_utils.h
src/include/utils/cash.h
src/include/utils/date.h
src/include/utils/expandeddatum.h
src/include/utils/expandedrecord.h
src/include/utils/geo_decls.h
src/include/utils/inet.h
src/include/utils/jsonb.h
src/include/utils/jsonpath.h
src/include/utils/multirangetypes.h
src/include/utils/numeric.h
src/include/utils/pg_lsn.h
src/include/utils/rangetypes.h
src/include/utils/timestamp.h
src/include/utils/uuid.h
src/include/utils/varbit.h
src/include/utils/xid8.h
src/include/utils/xml.h