Re: Text <-> C string

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Text <-> C string
Дата
Msg-id 27654.1190416142@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Text <-> C string  ("Brendan Jurd" <direvus@gmail.com>)
Ответы Re: Text <-> C string
Re: Text <-> C string
Список pgsql-hackers
"Brendan Jurd" <direvus@gmail.com> writes:
> I just noticed a couple of macros defined in src/include/tsearch/ts_utils.h:

> #define TextPGetCString(t)
> DatumGetCString(DirectFunctionCall1(textout, PointerGetDatum(t)))
> #define CStringGetTextP(c) DatumGetTextP(DirectFunctionCall1(textin,
> CStringGetDatum(c)))

> Seems these would actually be convenient in quite a lot of places in
> the backend.  Is there any downside to moving these two into
> src/include/postgres.h?

I think if you look around you'll find several similar things in various
contrib modules.  It would make some sense to try to unify all this.
I'm not particularly for making it macros in postgres.h though ---
that's no help if the macros require referencing stuff in builtins.h.

On grounds of code-space savings I think it might be worth making
these things be simple functions declared in builtins.h; that would
also make it much easier to change their implementations.
        regards, tom lane


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