Search Postgresql Archives

cast type bytea to double precision

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



HI All,

I have a database column which type is bytea. It contains floats converted as byte array (4 bytes per one float) and encoding is Escape. I would be able to get corresponding bytea string using substring function.

My question is how can I convert bytea string to float inside a SQL function. Earlier I converted to float in C# side. I used dataReader.getByte method to retrieve bytes and then Converted to float using BitConverter.ToSingle (.Net build in class) method.

Now I can't use intermediate component as Npqsql driver. I want SQL to directly convert bytea into floats and return the corresponding number when execute a query from 3rd party application.

Thanks and Regards
 Amila Jayasooriya



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux