Thread: shared memory size

shared memory size

From
Wei Weng
Date:
Will increasing kernel shared memory size (in linux by doing "echo
134217728 >/proc/sys/kernel/shmall; echo 134217728
>/proc/sys/kernel/shmmax) help with the speed of a complicated query
with a large return set? (average 20000 or more entries in return)

Thanks

-- 
Wei Weng
Network Software Engineer
KenCast Inc.




C Functions

From
"Fernando Eduardo B. L. e Carvalho"
Date:
#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)


Re: C Functions

From
Patrik Kudo
Date:
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:

>
>