Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: libpq: PQexecParams, binaryFormat and float



"Sun, Way" <Way(dot)Sun(at)sciatl(dot)com> writes:
>     float    loadavg;
>     loadavg = htonl(1.23);

It seems entirely unlikely that that will produce a byte-reversed float
value; what I think will happen is that the byte-reversed value of
integer 1 will be converted into a host-format float and stored into
loadavg.

AFAIK you can't really do this in C without a union.  Take a look at 
pq_sendfloat4 and pq_getmsgfloat4 in the backend for examples.

			regards, tom lane



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group