Calling 'c' function from PostGreSQL

Поиск
Список
Период
Сортировка
От Atul
Тема Calling 'c' function from PostGreSQL
Дата
Msg-id 001201c0c0e2$6cb53250$5e05a8c0@atul
обсуждение исходный текст
Ответы Re: Calling 'c' function from PostGreSQL  (Nabil Sayegh <evolution@sayegh.de>)
Re: Calling 'c' function from PostGreSQL  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-novice
Is it possible to call a language 'C'  function from a PL/pgSQL function. I have the following code:
 
// file myfunc.c
#include "postgres.h"
 
text* myfunc();
 
text* myfunc()
{
 text* ch;
 *ch = '1,2';
 return ch;
}
 
// C file ends here
 
create function myfunc as
'myfunc.so' langauge 'c';
 
create function test() returns text as '
declare
    at text;
begin
    at := myfunc();
    return at;
end;
' language 'plpgsql';
 
The above when executed gives pqReadData()-- backend closed the channel unexpectedly.
 
 

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

Предыдущее
От: "Brett W. McCoy"
Дата:
Сообщение: Re: copy from multi-line text problem
Следующее
От: Nabil Sayegh
Дата:
Сообщение: Re: Calling 'c' function from PostGreSQL