pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Convert *GetDatum() and DatumGet*() macros to inline functions
2+ messages / 1 participants
[nested] [flat]

* pgsql: Convert *GetDatum() and DatumGet*() macros to inline functions
@ 2022-09-12 15:58  Peter Eisentraut <peter@eisentraut.org>
  0 siblings, 0 replies; 2+ messages in thread

From: Peter Eisentraut @ 2022-09-12 15:58 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/595836e99bf1ee6d43405b885fb69bb8c6d3ee23

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              | 275 +++++++++++++++++++++++++-----------
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, 659 insertions(+), 190 deletions(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* pgsql: Convert *GetDatum() and DatumGet*() macros to inline functions
@ 2022-09-27 19:14  Peter Eisentraut <peter@eisentraut.org>
  0 siblings, 0 replies; 2+ messages in thread

From: Peter Eisentraut @ 2022-09-27 19:14 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2022-09-27 19:14 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2022-09-12 15:58 pgsql: Convert *GetDatum() and DatumGet*() macros to inline functions Peter Eisentraut <peter@eisentraut.org>
2022-09-27 19:14 pgsql: Convert *GetDatum() and DatumGet*() macros to inline functions Peter Eisentraut <peter@eisentraut.org>

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