[GENERAL] Is float8 a reference type? - Mailing list pgsql-general

From Paul A Jungwirth
Subject [GENERAL] Is float8 a reference type?
Date
Msg-id CA+renyXDNtPyB+fhcDQXYh2+FhnYArEPVpcph+k3Pi65MKUf1A@mail.gmail.com
Whole thread Raw
Responses Re: [GENERAL] Is float8 a reference type?  (Paul A Jungwirth <pj@illuminatedcomputing.com>)
Re: [GENERAL] Is float8 a reference type?  (Pavel Stehule <pavel.stehule@gmail.com>)
List pgsql-general
The docs say that a Datum can be 4 bytes or 8 depending on the machine:

https://www.postgresql.org/docs/9.5/static/sql-createtype.html

Is a Datum always 8 bytes for 64-bit architectures?

And if so, can my C extension skip a loop like this when compiling
there, and just do a memcpy (or even a cast)?:
   float8 *floats;   Datum *datums;
   datums = palloc(arrlen * sizeof(Datum));   for (i = 0; i < arrlen; i++) {     datums[i] = Float8GetDatum(floats[i]);
 }
 

Thanks!
Paul


-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

pgsql-general by date:

Previous
From: legrand legrand
Date:
Subject: Re: [GENERAL] Multicolumn Index on OR conditions
Next
From: Pavel Stehule
Date:
Subject: Re: [GENERAL] Is float8 a reference type?