Re:

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re:
Дата
Msg-id 26707.1333553493@sss.pgh.pa.us
обсуждение исходный текст
Ответ на  (Vincas Dargis <vindrg@gmail.com>)
Список pgsql-general
Vincas Dargis <vindrg@gmail.com> writes:
> I am experimenting with user defined functions in C, though I have
> problem with stability.

The only obvious problem in what you posted is

>        command = "SELECT 1";
> ...
>        pfree(command);

pfree'ing a constant is pretty much guaranteed to crash.
I am guessing the reason you don't see "5" printed is that
the if() fails, though it's not obvious why.

More generally, instead of putting an elog every two lines,
I'd suggest expending the effort to learn to use a debugger.
Having something that actually traps at the point of a crash
is a lot more useful than trying to triangulate on the problem
between inserted prints.

            regards, tom lane

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

Предыдущее
От: Jon Nelson
Дата:
Сообщение: Re: views, queries, and locks
Следующее
От: leaf_yxj
Дата:
Сообщение: Questions of the privileges to use the pg_cancel_backend and pg_terminate_backend function. Thanks.