Re: [SQL] Window function frame clause

2012-02-17 Thread vpapavas
Thank you David for your fast response. -- View this message in context: http://postgresql.1045698.n5.nabble.com/Window-function-frame-clause-tp5491171p5494599.html Sent from the PostgreSQL - sql mailing list archive at Nabble.com. -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)

[SQL] hstore and populate_record

2012-02-17 Thread Jan Eskilsson
Hi All Background, I have a table that i need to audit changes for tracability etc. I found an example on one of the postgres lists to use hstore:s to store the audit data. I find this to be a really good idea since its really simple to implement and it works really well. But now comes next step

[SQL] How can I use this subselect properly in an update?

2012-02-17 Thread John Tuliao
select substring(t1.called_number from t2.offset), t1.called_number from calls_join as t1, john_prefix as t2 where strpos(t1.called_number, t2.prefix) = '1' order by length(t2.prefix) desc limit '1' ; I'm having trouble using this as a sub-select in an UPDATE. Most of the

[SQL] cast type bytea to double precision

2012-02-17 Thread Amila Jayasooriya
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