From: Ivan Sergio Borgonovo on
I'm having a hard time trying to understand how everything should be
done in C extensions.

Now I'm trying to understand how and when I should accept/return
cstring vs text and if and how I should take care of any encoding.

I'm trying to output the content of a tsvector as a set of record
pos, weight, text|cstring
I've found tsvectorout that should be enough "educational".
But I still miss details about when/why use cstrings vs. text and
encoding.

Is there any part of the code from where I could learn about:
- memory allocation for both cstring and text
- example of returning text (especially if size of out>in)
- what should I take care of for encoding (what's really inside a
tsvector, text, cstring)?

I don't know if pgsql-hackers is the right place to ask and if this
kind of questions are considered "homework" but without any
reference and knowledge of the code base it's pretty hard even to
find prototype/sample code.

thanks

--
Ivan Sergio Borgonovo
http://www.webthatworks.it


--
Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers