On Thu, May 25, 2000 at 01:25:19PM +0200, Louis-David Mitterrand wrote:
> On Thu, May 25, 2000 at 12:51:52PM +0200, Karel Zak wrote:
> >
> > float32 result = (float32) palloc(sizeof(float32data));
SHould I pfree(result) before the end of the trigger function?
> > *result = 10.5;
> > SPI_modifytuple(relation, tupdesc, &attnum, Float32GetDatum(result),
> > NULL);
Instead of :
float64 result = (float64) palloc(sizeof(float64data));SPI_modifytuple(relation, tupdesc,
&attnum,Float32GetDatum(result),NULL);
Can I do double result = 10.5; /* for example */SPI_modifytuple(relation, tupdesc,
&attnum,Float32GetDatum(&result),NULL); ^^^
ie: pass the address of (regular double) "result" instead of using a
pointer;
--
Louis-David Mitterrand - ldm@apartia.org - http://www.apartia.fr
I don't build computers, I'm a cooling engineer. -- Seymour Cray, founder of Cray Inc.