pgsql: Remove byte-masking macros for Datum conversion macros

Started by Peter Eisentrautover 8 years ago2 messagescomitters
Jump to latest
#1Peter Eisentraut
peter_e@gmx.net

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

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Peter Eisentraut (#1)
Re: pgsql: Remove byte-masking macros for Datum conversion macros

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