-
Notifications
You must be signed in to change notification settings - Fork 71
How do you use timestamps with postgresql-simple? #74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Also, As for parsing UUIDs directly from bytestrings, that would depend on whether or not the underlying library supports it. Last I was aware, neither of the uuid packages on hackage has a parser for bytestrings. Of course, you could always write a bytestring parser yourself, outside the library. If you do, you might try to open a pull request for the library in question. |
Ok, I guess that the Also, both the |
Thanks @lpsmith. I changed the column to timestamptz and the code worked fine. I tried the toByteString initially, but postgres didn't like the bytes. Perhaps I need to encode it to utf-8 or something? You mention the Conversion and RowParser monads - is there any documentation on which to use and where? Thanks |
Uhh, in your FromField instance, or your ToField instance? I don't really know why this would be off the top of my head. You'd have to investigate that yourself.
You are already using them: Conversion is the monad the So for example, you could define your own
and use it in your fromField and fromRow definitions. |
add withConnect: Memory bracket around `connect` and `close`
Here's my table:
At the moment I've got a type like this:
I tried changing the
UTCTime
to aUTCTimestamp
I managed to get as far as inserting a row:
However selecting with:
gives:
or when I use
UTCTimestamp
:Any idea what I might be doing wrong here?
BTW any insight into getting UUID to work with ByteStrings would also be appreciated - I'm sure a round trip through
String
can't be a good thing!The text was updated successfully, but these errors were encountered: