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

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: ldm(at)apartia(dot)com
Cc: Karel Zak <zakkr(at)zf(dot)jcu(dot)cz>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: understanding Datum -> char * -> Datum conversions
Date: 2000-05-25 13:42:48
Message-ID: 200005251342.JAA17089@candle.pha.pa.us
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.

That was my fault. I told you on IRC that float(float8) was float32,
and that float4 was float16. In fact float(float8) is float64, and
float4 is float32.

--
Bruce Momjian | http://www.op.net/~candle
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Mikheev, Vadim 2000-05-25 14:31:35 RE: More Performance
Previous Message Matthias Urlichs 2000-05-25 13:40:50 Re: Berkeley DB...