Re: Internal function call from C-language function

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Zoltan Boszormenyi <zboszor(at)dunaweb(dot)hu>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Internal function call from C-language function
Date: 2006-12-07 12:10:56
Message-ID: 20061207121056.GB19846@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Dec 07, 2006 at 12:55:47PM +0100, Zoltan Boszormenyi wrote:
> However, I have another problem. I have this in the code:

<snip>

> yeardatum = CStringGetDatum("year");
> elog(NOTICE, "CStringGetDatum() 1 OK");
> returndatum = DirectFunctionCall2(timestamp_part, yeardatum,
> timest);

You're passing a cstring as first argument, whereas I'm fairly sure you
should be passing text. When calling from C the're no argument
checking. I think what you're looking for is:

yeardatum = text_in("year");

Or something like that.

Hope this helps,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Hannes Dorbath 2006-12-07 12:20:03 Re: Tsearch2 / PG 8.2 Which stemmer files?
Previous Message Zoltan Boszormenyi 2006-12-07 11:55:47 Re: Internal function call from C-language function