postgresql-simple icon indicating copy to clipboard operation
postgresql-simple copied to clipboard

Add interval Type

Open SamProtas opened this issue 7 years ago • 3 comments

I took a stab at adding an Interval ADT to this library as per this conversation:

https://github.com/lpsmith/postgresql-simple/issues/176

Let me know your thoughts or any changes you'd like to see. FYI I'm a bit unsure about the appropriate precision for the Interval's fields.

Although I'm testing against PostgreSQL 9.6.3 I appear to have run into this bug (or something similar):

https://www.postgresql.org/message-id/CAMWF=HS++N9-NKsh-o5QSymvp0Np-VB0GdWwAt4uie1h8ZdNTQ@mail.gmail.com

so the Interval builder splits microseconds back out into hours/minutes/seconds/microseconds to keep the numbers low.

SamProtas avatar Jul 07 '17 02:07 SamProtas

FWIW, the only Travis build that failed appears to also be failing on master (cabal version issue) and is for the oldest GHC (7.6.3) being tested.

SamProtas avatar Jul 07 '17 03:07 SamProtas

Thanks for the PR. Yes, I am aware of the build issue with travis, and haven't looked into it too deeply yet. I will not hold that against you. :)

lpsmith avatar Jul 08 '17 19:07 lpsmith

this would be nice to merge

gbaz avatar Oct 06 '18 00:10 gbaz