<div dir="ltr">Got it kind of working, for some reason the interval type in my postgres instance does not correspond to the parser from kqr but i managed to implement a version that kind of works.  More importantly the experience has been great for understanding how to do my own conversion types.  Thanks for the help.<div><br><br>On Saturday, January 3, 2015 9:53:31 PM UTC+11, Tom Ellis wrote:<blockquote class="gmail_quote" style="margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">On Tue, Dec 30, 2014 at 04:59:29PM -0800, <a href="javascript:" target="_blank" gdf-obfuscated-mailto="0-dq_ogJrzoJ" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">in...@rotnetix.com</a> wrote:
<br>> That might be tricky... 
<br>>  See <a href="https://github.com/lpsmith/postgresql-simple/pull/115" target="_blank" onmousedown="this.href='https://www.google.com/url?q\75https%3A%2F%2Fgithub.com%2Flpsmith%2Fpostgresql-simple%2Fpull%2F115\46sa\75D\46sntz\0751\46usg\75AFQjCNGBUBhC7y111b326xsFHoohcIJZJg';return true;" onclick="this.href='https://www.google.com/url?q\75https%3A%2F%2Fgithub.com%2Flpsmith%2Fpostgresql-simple%2Fpull%2F115\46sa\75D\46sntz\0751\46usg\75AFQjCNGBUBhC7y111b326xsFHoohcIJZJg';return true;">https://github.com/lpsmith/<wbr>postgresql-simple/pull/115</a>, it seems like 
<br>> it is not trivial to get the conversions to haskell types correct.
<br>> 
<br>> Look like I am back to native SQL for that one.  
<br>
<br>As lpsmith says here
<br>
<br>    <a href="https://github.com/lpsmith/postgresql-simple/pull/115#issuecomment-48754627" target="_blank" onmousedown="this.href='https://www.google.com/url?q\75https%3A%2F%2Fgithub.com%2Flpsmith%2Fpostgresql-simple%2Fpull%2F115%23issuecomment-48754627\46sa\75D\46sntz\0751\46usg\75AFQjCNGHL6blFElB2qdfRyvLj2D02d8Flw';return true;" onclick="this.href='https://www.google.com/url?q\75https%3A%2F%2Fgithub.com%2Flpsmith%2Fpostgresql-simple%2Fpull%2F115%23issuecomment-48754627\46sa\75D\46sntz\0751\46usg\75AFQjCNGHL6blFElB2qdfRyvLj2D02d8Flw';return true;">https://github.com/lpsmith/<wbr>postgresql-simple/pull/115#<wbr>issuecomment-48754627</a>
<br>
<br>you can use the attached patch in your own code to get a conversion from
<br>`interval` to `DiffTime`.  It will have a few strange corner cases but you
<br>will probably find you never hit them.
<br>
<br>Once you've done that you can make them suitable for Opaleye by writing
<br>
<br>    data PGInterval
<br>
<br>    instance QueryRunnerColumnDefault PGInterval DiffTime where
<br>          queryRunnerColumnDefault = fieldQueryRunnerColumn
<br>
<br>(you may have to import something from Opaleye.Internal.RunQuery).
<br>
<br>Please let me know how you get on with that, if you try it.
<br>
<br>Tom
<br>______________________________<wbr>_________________
<br>Haskell-Cafe mailing list
<br><a href="javascript:" target="_blank" gdf-obfuscated-mailto="0-dq_ogJrzoJ" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">Haskel...@haskell.org</a>
<br><a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Fwww.haskell.org%2Fmailman%2Flistinfo%2Fhaskell-cafe\46sa\75D\46sntz\0751\46usg\75AFQjCNHiVycCM53czUVzPma4Fkb_wPqP2A';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Fwww.haskell.org%2Fmailman%2Flistinfo%2Fhaskell-cafe\46sa\75D\46sntz\0751\46usg\75AFQjCNHiVycCM53czUVzPma4Fkb_wPqP2A';return true;">http://www.haskell.org/<wbr>mailman/listinfo/haskell-cafe</a>
<br></blockquote></div></div>