Re: Text <-> C string - Mailing list pgsql-hackers

From Brendan Jurd
Subject Re: Text <-> C string
Date
Msg-id 37ed240d0709211339m1e1be9a5u7f474a5e1dcae953@mail.gmail.com
Whole thread Raw
In response to Re: Text <-> C string  (Gregory Stark <stark@enterprisedb.com>)
Responses Re: Text <-> C string
List pgsql-hackers
On 9/22/07, Gregory Stark <stark@enterprisedb.com> wrote:
> The canonical way to do it is with
>
> DatumGetCString(DirectFunctionCall1(textout, t))

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?


pgsql-hackers by date:

Previous
From: Gregory Stark
Date:
Subject: Re: Text <-> C string
Next
From: "Brendan Jurd"
Date:
Subject: Re: Text <-> C string