pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedC Functions
2+ messages / 2 participants
[nested] [flat]
* C Functions
@ 2001-07-12 11:33 Fernando Eduardo B. L. e Carvalho <feblec@ig.com.br>
0 siblings, 1 reply; 2+ messages in thread
From: Fernando Eduardo B. L. e Carvalho @ 2001-07-12 11:33 UTC (permalink / raw)
To: pgsql-sql
Attachments:
email (text/plain, 405B) download
#include <pgsql/postgres.h>
#include <string.h>
char *fernando(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)
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: C Functions
@ 2001-07-12 15:16 Patrik Kudo <kudo@partitur.se>
parent: Fernando Eduardo B. L. e Carvalho <feblec@ig.com.br>
0 siblings, 0 replies; 2+ messages in thread
From: Patrik Kudo @ 2001-07-12 15:16 UTC (permalink / raw)
To: Fernando Eduardo B. L. e Carvalho <feblec@ig.com.br>; +Cc: pgsql-sql
I've never used functions in postgres, but the line
*resultp = *testo;
looks wrong to me. Shouldn't it be
strcpy(resultp, testo);
?
Regards,
Patrik Kudo
ech`echo xiun|tr nu oc|sed 'sx\([sx]\)\([xoi]\)xo un\2\1 is xg'`ol
Känns det oklart? Fråga på!
On Thu, 12 Jul 2001, Fernando Eduardo B. L. e Carvalho wrote:
>
>
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2001-07-12 15:16 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-07-12 11:33 C Functions Fernando Eduardo B. L. e Carvalho <feblec@ig.com.br>
2001-07-12 15:16 ` Patrik Kudo <kudo@partitur.se>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox