On 12/1/06, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> "Rajesh Kumar Mallah" <mallah(dot)rajesh(at)gmail(dot)com> writes:
> > data->time_stamp =
> > DirectFunctionCall1(timestamptz_in, CStringGetDatum("now"));
>
> This code is incorrect, as timestamptz_in takes three arguments.
replaced it with:
data->time_stamp = DirectFunctionCall3(timestamptz_in,
CStringGetDatum("now"),
ObjectIdGetDatum(InvalidOid),
Int32GetDatum(-1))
now it works fine. (code lifted from contrib/spi/moddatetime.c(line 73)
hopefully its correct.
regards, tom lane
>