I'm having trouble inserting a float into pg using binary format.
Hope someone on the list can help me point out what I'm doing wrong....
loadavg = htonl(1.23);
paramValues = (char *) &loadavg
paramLengths = sizeof(loadavg);
paramFormats = 1;
res = PQexecParams(conn,
"INSERT INTO cpu (loadavg) VALUES ($1::real)",
From psql, select returns the value as 1.20765e-38 instead of
- - - - - Appended by Scientific Atlanta, a Cisco company - - - - -
This e-mail and any attachments may contain information which is confidential,
proprietary, privileged or otherwise protected by law. The information is solely
intended for the named addressee (or a person responsible for delivering it to
the addressee). If you are not the intended recipient of this message, you are
not authorized to read, print, retain, copy or disseminate this message or any
part of it. If you have received this e-mail in error, please notify the sender
immediately by return e-mail and delete it from your computer.
pgsql-interfaces by date
|Next:||From: Tom Lane||Date: 2007-06-29 20:27:18|
|Subject: Re: libpq: PQexecParams, binaryFormat and float |
|Previous:||From: email@example.com||Date: 2007-06-27 07:24:21|
|Subject: How I can return a set of recordset from PL/Python|