version 1 C-Language Functions

Поиск
Список
Период
Сортировка
От Gowey, Geoffrey
Тема version 1 C-Language Functions
Дата
Msg-id E15F4B031E17D5118B18009027F67927DABE@SERVER
обсуждение исходный текст
Ответы Re: version 1 C-Language Functions  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Hi all,

I've been trying for days to figure this out, but just not have been able to
figure this out.  I'm creating a test function for me to start out using the
v1 functions, but it fails.

I'm doing a simple function:

PG_FUNCTION_INFO_V1(testfunction)

Datum
testfunction(PG_FUNCTION_ARGS)
{
    char *testb = PG_GETARG_CSTRING(0);
    int tr;
    tr = 1;
    elog(NOTICE, "%s\n",testb);
    PG_RETURN_INT16(tr);
}

I've declared it with "create function testfunction(text) returns int4 as
'....so' language 'c';"

and an trying to call it by "select testfunction('test@test.com');"

Unfortunately, this function fails.  What am i doing wrong?  Also, the docs
behind v1 functions is sketchy and example code seems to be pretty much
nonexistent (everything in the contrib is V0).  Where can I get further info
on writing sp's for pgsql in c?  Thanks.

Geoff

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

Предыдущее
От: "Aristeu Gil Alves Junior"
Дата:
Сообщение: Backup of Blob
Следующее
От: Peter Lauko
Дата:
Сообщение: problems on solaris 7