Re: Convert *GetDatum() and DatumGet*() macros to inline functions

Aleksander Alekseev <aleksander@timescale.com>

From: Aleksander Alekseev <aleksander@timescale.com>
To: pgsql-hackers <pgsql-hackers@postgresql.org>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Robert Haas <robertmhaas@gmail.com>, Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Date: 2022-08-30T14:25:32Z
Lists: pgsql-hackers
Tom, Robert,

> Yeah, I don't see a reason to back-patch a change like this

Maybe we should consider backporting at least 0001 patch, partially
perhaps? I believe if fixes pretty cursed pieces of code, e.g:

```
             pg_cryptohash_ctx *context =
-            (pg_cryptohash_ctx *) PointerGetDatum(foundres);
+            (pg_cryptohash_ctx *) DatumGetPointer(foundres);
```

This being said, personally I don't have a strong opinion here. After
all, the code works and passes the tests. Maybe I'm just being a
perfectionist here.

-- 
Best regards,
Aleksander Alekseev



Commits

  1. Convert *GetDatum() and DatumGet*() macros to inline functions

  2. Fix incorrect uses of Datum conversion macros