Re: C function accepting/returning cstring vs. text

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: C function accepting/returning cstring vs. text
Дата
Msg-id 20100127134402.GA18603@svana.org
обсуждение исходный текст
Ответ на Re: C function accepting/returning cstring vs. text  (Ivan Sergio Borgonovo <mail@webthatworks.it>)
Ответы Re: C function accepting/returning cstring vs. text  (Ivan Sergio Borgonovo <mail@webthatworks.it>)
Список 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 по дате отправления:

Предыдущее
От: Craig Ringer
Дата:
Сообщение: Re: C function accepting/returning cstring vs. text
Следующее
От: David Christensen
Дата:
Сообщение: Re: Patch: psql \whoami option