[prev in list] [next in list] [prev in thread] [next in thread]
List: postgresql-sql
Subject: [SQL] Stored procedures returning TEXT
From: Céline_Rivière <cr () fr ! netcentrex ! net>
Date: 2002-02-28 14:44:31
[Download RAW message or body]
Hello,
In 1999, someone asked you about the following problem. I have exactly the
same and couldn't solve it. Could you help me ?
Thanks.
Céline
---------------------------------------------------------------------
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
[Attachment #3 (text/html)]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 5.50.4134.600" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#fffbf0>
<DIV><FONT face="Bookman Old Style" color=#000080 size=2>
<DIV><FONT face="Bookman Old Style">Hello,</FONT></DIV>
<DIV><FONT face="Bookman Old Style"></FONT> </DIV>
<DIV>In 1999, someone asked you about the following problem. I have exactly
the</DIV>
<DIV>same and couldn't solve it. Could you help me ?</DIV>
<DIV> </DIV>
<DIV>Thanks.</DIV>
<DIV><BR>Céline</DIV>
<DIV> </DIV>
<DIV>---------------------------------------------------------------------</DIV>
<DIV> </DIV>
<DIV><FONT face="Bookman Old Style">Preinstalled postgresql-6.4.2 on
Linux-Elf<BR>Who know how write function(language 'c') which return text
type?<BR>I try<BR>#include "postgres.h"<BR><BR>text test(text
*t)<BR>{<BR>return(*t);<BR>}<BR>...<BR>made test.so,<BR>create function
test(text) returns text as 'path_to_test.so' language<BR>'c'<BR>and
finaly<BR>pgsql<BR>test=>select test('abc');<BR><STRONG>pqReadData() --
backend closed the channel
unexpectedly.<BR> This probably means
the backend terminated abnormally before or<BR>while processing the
request.<BR>We have lost the connection to the backend, so further processing
is<BR>impossible. Terminating.<BR></STRONG>Anybody have some examples
working text-type c-functions?<BR>Please send me if you
have</FONT></DIV></FONT></DIV></BODY></HTML>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic