Re: understanding Datum -> char * -> Datum conversions

From: Louis-David Mitterrand <cunctator(at)apartia(dot)ch>
To: Karel Zak <zakkr(at)zf(dot)jcu(dot)cz>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: understanding Datum -> char * -> Datum conversions
Date: 2000-05-25 11:25:19
Message-ID: 20000525132519.A11355@styx
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, May 25, 2000 at 12:51:52PM +0200, Karel Zak wrote:
> >
> > I'm reading these files but still got a problem:
>
>
> float32 result = (float32) palloc(sizeof(float32data));
>
> *result = 10.5;
> SPI_modifytuple(relation, tupdesc, &attnum, Float32GetDatum(result),
> NULL);
> Right?

Yes! It works now. My error was using a float32 instead of a float64, as
the internal type is really a float8. The confusion comes from defining
my tables with the type "float" which apparently defaults to float8.

Many thanks,

--
Louis-David Mitterrand - ldm(at)apartia(dot)org - http://www.apartia.fr

"2c98611832ea3f6f5fdda95d3704fbb8" (a truly random sig)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Louis-David Mitterrand 2000-05-25 12:40:07 pfree() after palloc() in trigger (was: Re: understanding Datum -> char * -> Datum conversions)
Previous Message Zeugswetter Andreas SB 2000-05-25 10:59:44 AW: Berkeley DB...