Re: Time to drop old-style (V0) functions?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Time to drop old-style (V0) functions?
Дата
Msg-id 17102.1490623836@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Time to drop old-style (V0) functions?  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers
Craig Ringer <craig@2ndquadrant.com> writes:
> I didn't have any way to make

>                 seg_l = (SEG *) DatumGetPointer(DirectFunctionCall2(seg_union,
>                         PointerGetDatum(seg_l),
> PointerGetDatum(sort_items[i].data)));

> pretty, but *shrug*.

For the builtin types, fmgr.h generally defines a datum-to-specific-
pointer-type macro, eg it has these for bytea:

#define DatumGetByteaP(X)           ((bytea *) PG_DETOAST_DATUM(X))
#define PG_GETARG_BYTEA_P(n)        DatumGetByteaP(PG_GETARG_DATUM(n))

(A type that doesn't have toast support would just use DatumGetPointer
instead of PG_DETOAST_DATUM.)  Replacing "(SEG *) DatumGetPointer(...)"
with "DatumGetSegP(...)" would help a little here.

I wouldn't necessarily do that if this is the only place that would
benefit, but there might be more scope for upgrading seg.c's notation
than just here.
        regards, tom lane



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: standardized backwards incompatibility tag for commits
Следующее
От: Corey Huinker
Дата:
Сообщение: Re: \if, \elseif, \else, \endif (was Re: PSQL commands:\quit_if, \quit_unless)