Re: calling elog possibly causing problem in DirectFunctionCall1

Поиск
Список
Период
Сортировка
От Rajesh Kumar Mallah
Тема Re: calling elog possibly causing problem in DirectFunctionCall1
Дата
Msg-id a97c77030612011058q513d02baofb496fd2ea7fa1c6@mail.gmail.com
обсуждение исходный текст
Ответ на Re: calling elog possibly causing problem in DirectFunctionCall1  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-sql


On 12/1/06, Tom Lane <tgl@sss.pgh.pa.us> wrote:
"Rajesh Kumar Mallah" <mallah.rajesh@gmail.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

В списке pgsql-sql по дате отправления:

Предыдущее
От: "Rajesh Kumar Mallah"
Дата:
Сообщение: Re: calling elog possibly causing problem in DirectFunctionCall1
Следующее
От: Chris Dunworth
Дата:
Сообщение: Problem inserting composite type values