Re: [SQL] C Functions

2001-07-12 Thread Patrik Kudo
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.

[SQL] C Functions

2001-07-12 Thread Fernando Eduardo B. L. e Carvalho
#include #include 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/fer

Re: [SQL] C functions and int8?

2000-09-21 Thread Tom Lane
Forest Wilkinson <[EMAIL PROTECTED]> writes: > That's an int8 meaning "eight bit integer". I want to work with an int8 > meaning "64 bit integer", as described in the docs: > http://www.postgresql.org/users-lounge/docs/7.0/user/datatype.htm#AEN942 > So how do I return one of these suckers from a

Re: [SQL] C functions and int8?

2000-09-21 Thread Forest Wilkinson
That's an int8 meaning "eight bit integer". I want to work with an int8 meaning "64 bit integer", as described in the docs: http://www.postgresql.org/users-lounge/docs/7.0/user/datatype.htm#AEN942 So how do I return one of these suckers from a C function? Forest On Thu, 21 Sep 2000 10:32:50 +0

Re: [SQL] C functions and int8?

2000-09-21 Thread Karel Zak
On Thu, 21 Sep 2000, Forest Wilkinson wrote: > I have written a few Postgres extension functions in C, and want to modify > some of them to return an int8. However, I don't see any int8 definition > in postgres.h. (I have the 7.0.2 RPMs installed.) How should I > accomplish this? in the sou

[SQL] C functions and int8?

2000-09-21 Thread Forest Wilkinson
I have written a few Postgres extension functions in C, and want to modify some of them to return an int8. However, I don't see any int8 definition in postgres.h. (I have the 7.0.2 RPMs installed.) How should I accomplish this?