Re: C function accepting/returning cstring vs. text - Mailing list pgsql-hackers

From Martijn van Oosterhout
Subject Re: C function accepting/returning cstring vs. text
Date
Msg-id 20100127134402.GA18603@svana.org
Whole thread Raw
In response to Re: C function accepting/returning cstring vs. text  (Ivan Sergio Borgonovo <mail@webthatworks.it>)
Responses Re: C function accepting/returning cstring vs. text  (Ivan Sergio Borgonovo <mail@webthatworks.it>)
List pgsql-hackers
On Wed, Jan 27, 2010 at 02:14:36PM +0100, Ivan Sergio Borgonovo wrote:
> I haven't been able to understand the difference between function
> returning cstring and text and if there is any need to be careful
> about encoding and escaping when copying from the lexeme to a buffer
> that will return a cstring or text.

Well, the difference is that one is a cstring and the other is text.
Seriously though, text is more useful if you want people to be able to
use the result in other functions since on SQL level almost everything
is text. cstring is needed for some APIs but it generally not used
unless necessary.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Please line up in a tree and maintain the heap invariant while
> boarding. Thank you for flying nlogn airlines.

pgsql-hackers by date:

Previous
From: Craig Ringer
Date:
Subject: Re: C function accepting/returning cstring vs. text
Next
From: David Christensen
Date:
Subject: Re: Patch: psql \whoami option