return varchar from C function

Started by scotty@linuxtime.italmost 19 years ago1 messages
#1scotty@linuxtime.it
scotty@linuxtime.it

Hi,
just for fun, I wrote a little postgresql contrib,
who has a C function called myfun inside it.
The function myfun returns a value , now I return
a cstring type value, and it works fine if
I run from psql shell:

select value from myfun(paramteres);

but I can't do an insert like:

insert (charfield) select value from myfun(paramteres);

becuse I have an error, exactly casting error.

I want that myfun returns a char,varchar, or text type.

Where I can find more documentation about differences between
cstring,char,text etc...?

Regards,
Enrico