return varchar from C function

From: "scotty(at)linuxtime(dot)it" <scotty(at)linuxtime(dot)it>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: return varchar from C function
Date: 2007-02-18 17:56:08
Message-ID: 1171821368468.scotty@linuxtime.it
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Hannu Krosing 2007-02-18 18:14:00 Re: RFC: Temporal Extensions for PostgreSQL
Previous Message Tom Lane 2007-02-18 17:35:58 Re: Plan invalidation design