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