pgsql: Remove byte-masking macros for Datum conversion macros

Поиск
Список
Период
Сортировка
Искать

pgsql: Remove byte-masking macros for Datum conversion macros

От:
Peter 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 

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

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Peter Eisentraut  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

FAQ