Re: Text <-> C string

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

"Brendan Jurd" <direvus(at)gmail(dot)com> writes:

> Surely having the exact same four lines of code written out in dozens
> of places is a Bad Thing, but perhaps there is some reasoning behind
> this that I am missing?

The canonical way to do it is with

DatumGetCString(DirectFunctionCall1(textout, t))

--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Brendan Jurd 2007-09-21 20:12:46 Re: Text <-> C string
Previous Message Tom Lane 2007-09-21 19:00:22 Re: HOT is applied

Browse pgsql-patches by date

  From Date Subject
Next Message Brendan Jurd 2007-09-21 20:12:46 Re: Text <-> C string
Previous Message Brendan Jurd 2007-09-21 18:43:18 Text <-> C string