C Function - Mailing list pgsql-interfaces

From feblec
Subject C Function
Date
Msg-id Pine.LNX.4.33.0107130526360.1717-100000@s1.carvalho.com.br
Whole thread Raw
Responses Re: C Function  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-interfaces
#include <pgsql/postgres.h>
#include <string.h>

unsigned char *fernando(unsigned char *texto)
{char *resultp = palloc(strlen(texto)+5);resultp = texto;strcat(resultp," mais");return resultp;
}

gcc -shared fernando.c -o fernando.so

CREATE FUNCTION fernando (bpchar) RETURNS bpchar AS '/u/src/tef/fernando.so' LANGUAGE 'c';
CREATE
SELECT fernando ('Teste');
ERROR:  Memory exhausted in AllocSetAlloc(287341377)


-- 

Fernando Edurado B. L. e Carvalho
Development/Consultant



pgsql-interfaces by date:

Previous
From: Manika Dey
Date:
Subject: postgres access from windowsNT
Next
From: "GANGAPURAM JAIPAL"
Date:
Subject: Clob - Issue