Re: Text <-> C string

From: "Brendan Jurd" <direvus(at)gmail(dot)com>
To: "Gregory Stark" <stark(at)enterprisedb(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Text <-> C string
Date: 2007-09-21 20:39:21
Message-ID: 37ed240d0709211339m1e1be9a5u7f474a5e1dcae953@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

On 9/22/07, Gregory Stark <stark(at)enterprisedb(dot)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?

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Brendan Jurd 2007-09-21 21:02:20 Re: Text <-> C string
Previous Message Gregory Stark 2007-09-21 20:33:38 Re: Text <-> C string

Browse pgsql-patches by date

  From Date Subject
Next Message Brendan Jurd 2007-09-21 21:02:20 Re: Text <-> C string
Previous Message Gregory Stark 2007-09-21 20:33:38 Re: Text <-> C string