C Function

From: feblec <carvalho(at)ig(dot)com(dot)br>
To: <pgsql-interfaces(at)postgresql(dot)org>
Subject: C Function
Date: 2001-07-13 08:29:53
Message-ID: Pine.LNX.4.33.0107130526360.1717-100000@s1.carvalho.com.br
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-interfaces by date

  From Date Subject
Next Message Sandro Dentella 2001-07-13 09:35:27 Re: pgaccess - international characters
Previous Message Lars Bensmann 2001-07-12 23:32:22 pgaccess - international characters