Text type function - Mailing list pgsql-sql

From Yuri Yurchenko
Subject Text type function
Date
Msg-id 36A5ADB6.8D8BEC93@hawk.gu.net
Whole thread Raw
List pgsql-sql
Preinstalled postgresql-6.4.2 on Linux-Elf
Who know how write function(language 'c') which return text type?
I try
#include "postgres.h"

text test(text *t)
{
return(*t);
}
...
made test.so,
create function test(text) returns text as 'path_to_test.so' language
'c'
and finaly
pgsql
test=>select test('abc');
pqReadData() -- backend closed the channel unexpectedly.
        This probably means the backend terminated abnormally before or
while processing the request.
We have lost the connection to the backend, so further processing is
impossible.  Terminating.
Anybody have some examples working text-type c-functions?
Please send me if you have.


pgsql-sql by date:

Previous
From: Herouth Maoz
Date:
Subject: Re: [SQL] set type and in clause
Next
From: "Jackson, DeJuan"
Date:
Subject: RE: [SQL] Beginner question - select with multiple tables