pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Convert *GetDatum() and DatumGet*() macros to inline functions
Date: Tue, 27 Sep 2022 19:14:36 +0000
Message-ID: <E1odG2O-002Hmc-2q@gemulon.postgresql.org> (raw)

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.

For the *GetDatumFast() macros, converting to an inline function
doesn't work in the !USE_FLOAT8_BYVAL case, but we can use
AssertVariableIsOfTypeMacro() to get a similar level of type checking.

Reviewed-by: Aleksander Alekseev <aleksander@timescale.com>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://www.postgresql.org/message-id/flat/8528fb7e-0aa2-6b54-85fb-0c0886dbd6ed%40enterprisedb.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/c8b2ef05f481ef06326d7b9f3eb14b303f215c7e

Modified Files
--------------
contrib/intarray/_int_gist.c        |   2 +-
doc/src/sgml/xfunc.sgml             |   2 +-
src/backend/access/gist/gistutil.c  |   2 +-
src/backend/tsearch/ts_parse.c      |   4 +-
src/backend/utils/mb/mbutils.c      |  12 +-
src/include/access/gin.h            |  14 +-
src/include/funcapi.h               |  14 +-
src/include/postgres.h              | 267 ++++++++++++++++++++++++------------
src/include/tsearch/ts_type.h       |  46 +++++--
src/include/tsearch/ts_utils.h      |  14 +-
src/include/utils/cash.h            |  14 +-
src/include/utils/date.h            |  42 +++++-
src/include/utils/expandeddatum.h   |  13 +-
src/include/utils/expandedrecord.h  |  16 ++-
src/include/utils/geo_decls.h       |  98 ++++++++++---
src/include/utils/inet.h            |  49 ++++++-
src/include/utils/jsonb.h           |  31 +++--
src/include/utils/jsonpath.h        |  14 +-
src/include/utils/multirangetypes.h |  23 +++-
src/include/utils/numeric.h         |  21 ++-
src/include/utils/pg_lsn.h          |  13 +-
src/include/utils/rangetypes.h      |  23 +++-
src/include/utils/timestamp.h       |  44 ++++--
src/include/utils/uuid.h            |  15 +-
src/include/utils/varbit.h          |  21 ++-
src/include/utils/xid8.h            |  14 +-
src/include/utils/xml.h             |  13 +-
27 files changed, 651 insertions(+), 190 deletions(-)



view thread (2+ messages)

Message-ID: <E1odG2O-002Hmc-2q@gemulon.postgresql.org>
Permalink:  ../E1odG2O-002Hmc-2q@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1odG2O-002Hmc-2q@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: peter@eisentraut.org
  Subject: Re: pgsql: Convert *GetDatum() and DatumGet*() macros to inline functions
  In-Reply-To: <E1odG2O-002Hmc-2q@gemulon.postgresql.org>
  References: <E1odG2O-002Hmc-2q@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