Thread: pgsql: Remove byte-masking macros for Datum conversion macros

pgsql: Remove byte-masking macros for Datum conversion macros

From
Peter Eisentraut
Date:
Remove byte-masking macros for Datum conversion macros

As the comment there stated, these were needed for old-style
user-defined functions, but since we removed support for those, we don't
need this anymore.

Reviewed-by: Michael Paquier <michael.paquier@gmail.com>

Branch
------
master

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

Modified Files
--------------
src/include/postgres.h | 90 +++++++++++++++++++-------------------------------
1 file changed, 34 insertions(+), 56 deletions(-)


Re: pgsql: Remove byte-masking macros for Datum conversion macros

From
Tom Lane
Date:
Peter Eisentraut <peter_e@gmx.net> writes:
> Remove byte-masking macros for Datum conversion macros

Looking at the code now, I think there's at least one bad outcome of
this change: the behavior of CharGetDatum() is now ill-defined, because
we'll (probably) get different results on signed-char and unsigned-char
compilers.  I think we'd be well advised to make that macro be

#define CharGetDatum(X) ((Datum) ((unsigned char) (X)))

            regards, tom lane