Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-interfaces by date

Next:From: Sandro DentellaDate: 2001-07-13 09:35:27
Subject: Re: pgaccess - international characters
Previous:From: Lars BensmannDate: 2001-07-12 23:32:22
Subject: pgaccess - international characters

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group