Re: [BUGS] Memory Allocation Error

2007-09-24 Thread Tom Lane
Gregory Stark <[EMAIL PROTECTED]> writes: > "zhuge xiao" <[EMAIL PROTECTED]> writes: >> I wrote and compiled and linked a C function, add_float, which returns >> float in C like following: > float8 and float aren't the same thing. "float" is a C data type which is not > wide enough to hold a float

Re: [BUGS] Memory Allocation Error

2007-09-24 Thread Gregory Stark
"zhuge xiao" <[EMAIL PROTECTED]> writes: > I wrote and compiled and linked a C function, add_float, which returns > float in C like following: > > PG_FUNCTION_INFO_V1(add_float); > > Datum > add_float(PG_FUNCTION_ARGS) > { > float arg = PG_GETARG_FLOAT8(0); > > PG_RETURN_FLOAT8(arg + 10); > } > >

[BUGS] Memory Allocation Error

2007-09-24 Thread zhuge xiao
I wrote and compiled and linked a C function, add_float, which returns float in C like following: PG_FUNCTION_INFO_V1(add_float); Datum add_float(PG_FUNCTION_ARGS) { float arg = PG_GETARG_FLOAT8(0); PG_RETURN_FLOAT8(arg + 10); } After having loaded it into database, executed the SQL command, "s