cast type bytea to double precision - Mailing list pgsql-sql

From Amila Jayasooriya
Subject cast type bytea to double precision
Date
Msg-id CACqosVSfPRdtRbVJJHdQePY0EbDnZS7cnGbgCwo9bfpUVcq8xA@mail.gmail.com
Whole thread Raw
List pgsql-sql
HI All,<br /><br />I have a database column which type is bytea. It contains floats converted as byte array (4 bytes
perone float) and encoding is Escape. I would be able to get corresponding bytea string using substring function.<br
/><br/>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
buildin class) method.<br /><br />Now I can't use intermediate component as Npqsql driver. I want SQL to directly
convertbytea into floats and return the corresponding number when execute a query from 3rd party application. <br /><br
clear="all"/>Thanks and Regards<br />  Amila Jayasooriya<br /><br /> 

pgsql-sql by date:

Previous
From: David Johnston
Date:
Subject: Re: Window function frame clause
Next
From: John Tuliao
Date:
Subject: How can I use this subselect properly in an update?