Re: return varchar from C function - Mailing list pgsql-hackers

From Martijn van Oosterhout
Subject Re: return varchar from C function
Date
Msg-id 20070218150855.GB6828@svana.org
Whole thread Raw
In response to return varchar from C function  ("scotty@linuxtime.it" <scotty@linuxtime.it>)
List pgsql-hackers
On Sun, Feb 18, 2007 at 12:56:08PM -0500, scotty@linuxtime.it wrote:
> 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:

You don't provide the definition you used, but:

> select value from myfun(paramteres);

This isn't the usual way to return things, unless it is a set returning
function. Did you provide the return type at declaration time?

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

pgsql-hackers by date:

Previous
From: Gregory Stark
Date:
Subject: Re: return varchar from C function
Next
From: "Pavel Stehule"
Date:
Subject: Re: return varchar from C function